
Chapter 6: C Programming-Interface
23
6
C Programming-Interface
6.1
Overview
The C programming-interface is provided as a means to display the correct value for any given type
of parameter. Without this interface, you would have to create all tables and conversions yourself in
order to display the value of all parameters.
The interface consists of 2 files, CLASS.C and CLASS.H, which can be downloaded from the TC
User-Club BBS. The phone-numbers are listed in the beginning of this manual.
6.2
Using The Interface
The interface is platform-independent and only requires the ANSI Standard Libraries stdio, string
and math to be present.
The only routine you need to call is this:
void class_GetStr (char *s, WORD idClass, short v);
where
s
is an array of
7 chars
to receive the string,
idClass
is the class-number as found
in the algorithm-listings and
v
is the value.
Keep in mind that the string isn’t automatically null-terminated. You can null-terminate the string by
providing an 8-character string to
class_getStr
and then setting the 8th character to 0.
Because this code is taken directly from the M5000 application-software, the result is always printed
as a 7-character string which is padded with spaces. You are free to modify the code to display the
parameter-text in a less short-hand way, but keep in mind that the CLASS.C and CLASS.H files
probably will be updated in the future to support new algorithms. Your CLASS.C and CLASS.H files
will always remain compatible with existing algorithms, but if you would like to support new
algorithms, you must either make all your modifications again or add the new parameter-types by
hand.
Always make sure that the string you provide to
class_getStr
is large enough to contain the
reply.
A few of the classes are irrelevant to most applications, but they have been left in the interface to
simplify the process of providing it. You should not use classes such as CLS_BAR72, because their
character-string reply requires custom-characters that are only available in the M5000.
Summary of Contents for M5000
Page 8: ...GEN INSTR M5GENIN Rev 1 0 Page 3...
Page 10: ...GEN INSTR M5GENIN Rev 1 0 Page 5...
Page 154: ...APPENDIX C M5TROUBL Rev 1 5 Page 9...