Galil Motion Control DMC-21 5 Series User Manual page 112

Table of Contents

Advertisement

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.
:LZ 0
:PF 10
:DP 21
:TPA
0000000021
:PF4
:TPA
0021
:PF-4
:TPA
$0015
:PF2
:DP 121
:TPA
99
Adding Leading Zeros from Response to Interrogation Commands
The leading zeros on data returned as a response to interrogation commands can be added by the use of the
command, LZ. The
LZ
:LZ0
:TP
-0000000009, 0000000005
:LZ1
:TP
-9, 5
Local Formatting of Response of Interrogation Commands
The response of interrogation commands may be formatted locally. To format locally, use the command, {Fm.n} or
{$m.n} on the same line as the interrogation command. The symbol F specifies that the response should be
returned in decimal format and $ specifies hexadecimal. m is the number of digits to the left of the decimal, and n
is the number of digits to the right of the decimal.
:TP {F2.2}
-05.00, 05.00, 00.00,
07.00
:TP {$4.2}
FFFB.00,$0005.00,$0000.00,
$0007.00
Formatting Variables and Array Elements
The
VF
command is used to format variables and array elements. A negative sign can be used to specify
hexadecimal format. The default format for VF is VF 10.4 Hex values that are returned are preceded by a $ and in
2's complement.
:v1=10
:v1=?
10.0000
:VF2.2
:v1=?
10.00
:VF-2.2
Chapter 7 Application Programming ▫ 107
'disable suppressing leading zeroes
'set format to 10 places
'define position
'tell position
'change format to 4 places
'tell position
'change to hexadecimal format
'tell position
'change format to 2 places
'define new motor position
'reports 99 since value is more than 2 places
command is set to a default of 1.
'disables the LZ function
'tell position
'enables LZ
'tell position
'tell position in decimal format 2.2
'tell position in hexadecimal format 4.2
'assign v1 variable
'return v1
'change format
'return v1
'specify hex format
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents