
6.MACRO EXECUTOR FUNCTION B-63943EN-2/01
- 210 -
(2) Reading a specified character-type block (G328)
- Format
G328 Pp;
p : Maximum allowable number of variable data items
- Explanation
Even if a block specified in a CNC program is not represented as a
word-type block (in the format "address + number"), this command
enables the block to be read to a specified variable area by converting
each character to an ASCII code (decimal). At this time, the control
commands (WHILE/IF/...) and the functions (SIN/COS/FUP/..) are
represented as special codes.
By using address P, specify the maximum number of readable
variables. If a block to be read is so large that the variables more
than the specified maximum number of readable variables are
required, the read processing is stopped, and completion code 210 is
set in #8529.
Example 1
#8520 = Program number ;
#8521 = Block number;
#8522=100;(Read variable number)
G328 P9 ;
IF [#8529 NE 0] GOTO 900; (Error check)
When the block is "#1=SIN[#2];", the following is read:
#100 : 35 " # "
#101 : 49 " 1 "
#102 : 61 " = "
#103 : 276 "SIN"
#104 : 91 " [ "
#105 : 35 " # "
#106 : 50 " 2 "
#107 : 93 " ] "
#108 : 59 " ; "
If a block read using the function for reading a specified word-type
block (G325) is not a word-type block (but a character-type block),
completion code 253 is returned to #8529 for notification. If this
completion code is returned, read the block again by using the
function for reading a specified character-type block (G328).