Example – Yaskawa SMC–4000 User Manual
Page 345
![background image](https://www.manualsdir.com/files/819559/content/doc345.png)
335
SMC–4000 User Manual
Example:
The Variable Format (VF) command is used to format variables and array elements. The VF command is
specified by:
VF m.n
where m is the number of digits to the left of the decimal point (0 through 10) and n is the number of
digits to the right of the decimal point (0 through 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.
The variable format also affects returned values from internal variables such as _GNX.
PF and VF commands are global format commands. Parameters may also be formatted locally by using
the {Fn.m} or {$n.m} specification following the variable = . For example:
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. The local format is used with the MG* command.
:PF2
Format 2 places
:TPX
Tell position
99
Returns 99 if actual position is more than allowed format
:V1=10
Assign V1
:V1=
Return V1
0000000010.0000
Default format
:VF2.2
Change format
:V1=
Return V1
10.00
New format
:VF-2.2
Specify hex format
:V1=
Return V1
$0A.00
Hex value
:VF1
Change format
:V1=
Return V1
9
Overflow
V1={F4.2}
Specifies the variable V1 to be returned in a format of 4 digits to left of
decimal and 2 to the right.