Example - Printing a Variable and an Array element
Instruction
Interpretation
#DISPLAY
Label
DM posA[7]
Define Array posA with 7 entries
PR 1000
Position Command
BGX
Begin
AMX
After Motion
v1=_TPA
Assign Variable v1
posA[1]=_TPA
Assign the first entry
v1=
Print v1
Interrogation Commands
The DMC-42x0 has a set of commands that directly interrogate the controller. When these command are entered, the
requested data is returned in decimal format on the next line followed by a carriage return and line feed. The format of
the returned data can be changed using the Position Format (PF), and Leading Zeros (LZ) command. For a complete
description of interrogation commands, see
363H
Using the PF Command to Format Response from Interrogation Commands
The command, PF, can change format of the values returned by theses interrogation commands:
BL ?
LE ?
DE ?
PA ?
DP ?
PR ?
EM ?
TN ?
FL ?
VE ?
IP ?
TE
TP
The numeric values may be formatted in decimal or hexadecimal with a specified number of digits to the right and
left of the decimal point using the PF command.
Position Format is specified by:
PF m.n
where m is the number of digits to the left of the decimal point (0 thru 10) and n is the number of digits to the right
of the decimal point (0 thru 4) A negative sign for m specifies hexadecimal format.
Hex values are returned preceded by a $ and in 2's complement. Hex values should be input as signed 2's
complement, where negative numbers have a negative sign. The default format is PF 10.0.
If the number of decimal places specified by PF is less than the actual value, a nine appears in all the decimal
places.
Example
Instruction
Interpretation
:DP21
Define position
:TPA
Tell position
0000000021
Default format
:PF4
Change format to 4 places
:TPA
Tell position
0021
New format
:PF-4
Change to hexadecimal format
:TPA
Tell Position
$0015
Hexadecimal value
:PF2
Format 2 places
:TPA
Tell Position
99
Returns 99 if position greater than 99
Chapter 7 Application Programming ▫ 133
DMC-42x0 User Manual
Summary of Contents for DMC-42 0 Series
Page 195: ...ICM 2900 PCB Layout Appendices 191 DMC 42x0 User Manual...
Page 205: ...CB 50 100 Drawings Appendices 201 DMC 42x0 User Manual...
Page 206: ...Appendices 202 DMC 42x0 User Manual...
Page 207: ...Appendices 203 DMC 42x0 User Manual...
Page 208: ...Appendices 204 DMC 42x0 User Manual...
Page 209: ...Appendices 205 DMC 42x0 User Manual...
Page 210: ...Appendices 206 DMC 42x0 User Manual...
Page 211: ...Appendices 207 DMC 42x0 User Manual...
Page 214: ...CB 50 80 Drawing Appendices 210 DMC 42x0 User Manual...