Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 387 of 909
DFS(value)
Dump Float, Single
APPLICATION: Data conversion
DESCRIPTION: Get the af[index] variable in its raw 32-bit IEEE format
EXECUTION: Immediate
CONDITIONAL TO: N/A
LIMITATIONS: N/A
READ/REPORT: RDFS(value)
WRITE: N/A
LANGUAGE ACCESS: Formulas and conditional testing
UNITS: N/A
RANGE OF VALUES:
Input: Any float value within 32-bit float range:
±1x10
38
Output: 32-bit integer -2147483648 to 2147483647
TYPICAL VALUES: N/A
DEFAULT VALUE: N/A
FIRMWARE VERSION: 5.x and later
COMBITRONIC: N/A
DETAILED DESCRIPTION:
The DFS(value) command allows the creation of a 32-bit value in IEEE-754 format. This allows
export of floating-point values to external systems. This format may be needed for
interchange.
The 32-bit value output by this function is not the integer rounded off from the input. It is an
encoded number that includes the exponent of the floating point value. The output of this
function does not have any usefulness within the SmartMotor programming language.
EXAMPLE:
af[0]=(a+b)/3.0 'Create a floating-point result.
al[0]=DFS(af[0]) 'Dump the IEEE-754 32-bit representation
'into al[0].
PRINT(#ab[0],#ab[1],#ab[2],#ab[3]) 'Print the 4 bytes (32-bits)
'of this result to the serial port for the
'host PLCto interpret.
RELATED COMMANDS:
R
af[index]=formula Array Float [index] (see page 261)
R
ATOF(index) ASCII to Float (see page 284)
R
HEX(index) Decimal Value of a Hex String (see page 469)
R
LFS(value) Load Float Single (see page 516)
Part 2: Commands: DFS(value)