Reference Manual

PMAC 2 Software Reference
PMAC Program Command Specification 343
See Also
Rapid Mode Moves (Writing a Motion Program)
I-variables I50, Ix16, Ix19, Ix22
Program commands LINEAR, CIRCLE, PVT, SPLINE
READ
Function
Read Arguments for Subroutine
Type
Motion program (PROG only)
Syntax
READ({letter},[{letter}...])
where:
{letter} is any letter of the English alphabet, except N or O, representing the
letter on the calling program line whose following value is to be read into a variable.
Note:
No space is allowed between READ and the left parenthesis.
Remarks
This statement allows a subprogram or subroutine to take arguments from the calling
routine. It looks at the remainder of the line calling this routine (CALL, G, M, T, D), takes
the values following the specified letters and puts them into particular Q-variables for the
coordinate system. For the Nth letter of the alphabet, the value is put in Q(100+N).
It scans the calling line until it sees a letter that is not in the list of letters to READ, or
until the end of the calling line. Each letter value successfully “read” into a Q-variable
causes a bit to be set in Q100, noting that it was read (bit N-1 for the Nth letter of the
alphabet). For any letter not successfully read in the most recent READ command, the
corresponding bit of Q100 is set to zero.
The Q-variable and flag bit of Q100 associated with each letter are shown in the
following table:
Letter Target
Variable
Q100
Bit
Bit Value
Decimal
Bit Value
Hex
A Q101 0 1 $01
B Q102 1 2 $02
C Q103 2 4 $04
D Q104 3 8 $08
E Q105 4 16 $10
F Q106 5 32 $20
G Q107 6 64 $40
H Q108 7 128 $80
I Q109 8 256 $100
J Q110 9 512 $200
K Q111 10 1,024 $400
L Q112 11 2,048 $800
M Q113 12 4,096 $1000
N* Q114* 13* 8,192* $2000*
O* Q115* 14* 16,384* $4000*
P Q116 15 32,768 $8000
Q Q117 16 65,536 $10000
R Q118 17 131,072 $20000
S Q119 18 262,144 $40000
T Q120 19 524,288 $80000
U
Q
121 20 1,048,57 $100000