Formatting Variables And Array Elements - Galil Motion Control CDS-3310 User Manual

Table of Contents

Advertisement

Removing Leading Zeros from Response to Interrogation Commands
The leading zeros on data returned as a response to interrogation commands can be removed by the use
of the command, LZ.
Local Formatting of Response of Interrogation Commands
The response of interrogation commands may be formatted locally. To format locally, use the
command, {Fn.m} or {$n.m} on the same line as the interrogation command. The symbol F specifies
that the response should be returned in decimal format and $ specifies hexadecimal. n is the number of
digits to the left of the decimal, and m is the number of digits to the right of the decimal.

Formatting Variables and Array Elements

The Variable Format (VF) command is used to format variables and array elements. The VF
command is specified by:
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. The default format for VF is VF 10.4
Hex values are returned preceded by a $ and in 2's complement.
48 • Chapter 7 Application Programming
:TPA
99
LZ0
TP
-0000000009, 0000000005
LZ1
TP
-9, 5
TP {F2.2}
-05.00, 05.00, 00.00, 07.00
TP {$4.2}
FFFB.00,$0005.00,$0000.00,$0007.00
VF m.n
Instruction
v1=10
v1=
:0000000010.0000
VF2.2
v1=
:10.00
vF-2.2
v1=
$0A.00
VF1
v1=
:9
Tell Position
Returns 99 if position greater than 99
Disables the LZ function
Tell Position Interrogation Command
Response (With Leading Zeros)
Enables the LZ function
Tell Position Interrogation Command
Response (Without Leading Zeros)
Tell Position in decimal format 2.2
Response from Interrogation Command
Tell Position in hexadecimal format 4.2
Response from Interrogation Command
Interpretation
Assign v1
Return v1
Response - Default format
Change format
Return v1
Response - New format
Specify hex format
Return v1
Response - Hex value
Change format
Return v1
Response - Overflow
CDS-3310

Advertisement

Table of Contents
loading

Table of Contents