Formatting A String (Sprint) - Siemens Sinumerik 840D sl Programming Manual

Job planning
Hide thumbs Also See for Sinumerik 840D sl:
Table of Contents

Advertisement

Flexible NC programming
1.9 String operations
Example 2: Single character access with call-by-reference parameter
Program code
DEF STRING [50] STRG
DEF CHAR CHR1
EXTERN UP_CALL (VAR CHAR1)
...
CHR1 = STRG [5]
UP_CALL (CHR1)
STRG [5] = CHR1
1.9.9

Formatting a string (SPRINT)

Function
Using the pre-defined SPRINT function, character strings can be formatted and e.g. prepared
for output on external devices (also see "Output to an external device/file (EXTOPEN,
WRITE, EXTCLOSE) [Page 710]").
Syntax
"<Result_string>"=SPRINT("<Format_string>",<value_1>,<value_2>,...,
<value_n>)
Significance
SPRINT:
"<Format_String>":
<value_1>,<value_2>,...,<value_n>:
"<result_string>":
84
Comments
;
Call-by-reference parameters!
;
Call-by-reference
Identifier for a pre-defined function that
supplies a value, type STRING.
Character string that contains fixed and
variable elements. The variable elements
are defined using the format control
character % and a subsequent format
description.
Value in the form of a constant or NC
variables, which is inserted at the location
where the nth format control character % is
located, corresponding to the format
description in the <format_string>.
Formatted character string (maximum 400
bytes)
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Job planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de slSinumerik 828d

Table of Contents