Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC Program Command Specification 466
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.
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. (Note that if it encounters a letter not to be read, it stops, even if some letters have not yet
been read.) 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
Q121
20
1,048,57
$100000
V
Q122
21
2,097,15
$200000
W
Q123
22
4,194,304
$400000
X
Q124
23
8,388,608
$800000
Y
Q125
24
16,777,216
$1000000
Z
Q126
25
33,554,432
$2000000
*Cannot be used