Formatting Variables And Array Elements; Converting To User Units - Galil Motion Control DMC-1600 Series User Manual

Table of Contents

Advertisement

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.
:V1=10
:V1=
0000000010.0000
:VF2.2
:V1=
10.00
:VF-2.2
:V1=
$0A.00
:VF1
:V1=
9
Local Formatting of Variables
PF and VF commands are global format commands that effect the format of all relevant returned
values and variables. Variables may also be formatted locally. To format locally, use the
command, {Fn.m} or {$n.m} following the variable name and the '=' symbol. F specifies
decimal 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. For example:
Examples:
:V1=10
:V1=
0000000010.0000
:V1={F4.2}
0010.00
:V1={$4.2}
$000A.00
:V1="ALPHA"
:V1={S4}
ALPH
The local format is also used with the MG* command.

Converting to User Units

Variables and arithmetic operations make it easy to input data in desired user units such as inches
or RPM.
148 • Chapter 7 Application Programming
VF m.n
Assign V1
Return V1
Default format
Change format
Return V1
New format
Specify hex format
Return V1
Hex value
Change format
Return V1
Overflow
Assign V1
Return V1
Default Format
Specify local format
New format
Specify hex format
Hex value
Assign string "ALPHA" to V1
Specify string format first 4 characters
DMC-1600

Advertisement

Table of Contents
loading

Table of Contents