
B-63322EN-2/01 6. SYSTEM CALLS
- 29 -
6.5 MESSAGE OUTPUT (INTEGER: HEXADECIMAL NUMBER)
[Function name] sc_print_hex
[Function] Displays a message (integer) in hexadecimal notation.
[Format] int sc_print_hex (unsigned int num, int dgt, int sup);
[Input] Unsigned int num : Number to be output.
int dgt : Number of digits to be displayed (1 to 8)
int sup : Whether to suppress zeros in the display (0 = not suppress
and 1 = suppress).
[Output] 0 : Normal end.
Nonzero : Abnormal end (the value specified as the number of digits
to be displayed or the value specified for zero suppression
is invalid).
[Result] The output message can be viewed on the CNC-side message function
screen.
[Note] The display is right-justified.
If the number of digits in the actual number to be displayed is smaller
than the value specified as the number of digits to be displayed, the
actual display varies according to whether zero suppression is specified,
as follows:
• If zero suppression is not specified, as many zeros as the number of
insufficient digits are output.
• If zero suppression is specified, as many blanks as the number of
insufficient digits are output.
If the number of digits in the actual number to be displayed is larger
than the value specified as the number of digits to be displayed, the
specified value is ignored, and the actual number is output left-
justified.
6.6 MESSAGE OUTPUT (REAL NUMBER)
[Function name] sc_print_float
[Function] Displays a message (real number).
[Format] int sc_print_float (double num);
[Input] double num: Number to be output.
[Output] 0 : Normal end.
Nonzero: Abnormal end
[Result] The output message can be viewed on the CNC-side message function
screen.
[Note] The display is represented in exponential format (with up to 15
significant digits).
If the message is non-numeric, it is displayed as NaN. If it is infinite, it
is displayed as +Infinite or -Infinite.
Example) 1234567890.12345 is displayed as
+0.123456789012345E10.