Hardware manual
Commands and Functions E-H Impact Reference Guide
Datalogic Automation Inc. 5-14
FFTMAG()
This function computes the Fourier transform of the argument array. The argument is an array of two or
more real values. (Ideally the length should be a power of 2, e.g. 4, 8, 16, 64, 256).
After computing the transform, the function computes the magnitude of each complex output value (by mul-
tiplying the value by its complex conjugate and taking the square root of the result), and stores the magni-
tude back in the input array.
The function returns a True value if the transform was calculated successfully. The returned value should be
false only if an invalid input argument is passed. Example:
list[0] = 10
list[1] = 2
calc_bool = fftmag (list)
yields the following result
calc_bool = True
list[0] = 12
list[1] = 8
FIX()
This function returns the integral (non-decimal) part of the argument. If the argument is a negative non-inte-
ger number, it is truncated toward zero (less negative). If the argument is undef, the result is undef. This
function is similar to the INT function. The difference is that INT truncates down while FIX truncates
towards zero. The two functions are identical for positive numbers. Examples:
x = FIX (3.3) yields x = 3
x = FIX(-3.3) yields x = -3
FORMATDATE
This function uses a format string (the first argument) to format a time or date value (the second argument).
You can use a comma as a placeholder in the format string. If the second argument is missing or undefined,
then the current local time is converted. Example:
date_string = FORMATDATE("format",time)
This function call:
date_string = FORMATDATE ("WEEKDAY-NAME, *MONTH-NAME* DD at 0h:0m:0s pm",NOW)
yields
date_string = Friday, April 18 at 12:03:03 pm
The following format strings will produce the indicated display. Format strings are case sensitive. You may
also insert separation characters (such as colons, dashes, and slashes) to make the output more readable.
Format String Resultant display
YEAR four digit year
YY two digit year
MON three letter abbreviation of the month name
MM month number
0M month number with leading zero, if needed
*MONTH-NAME* month name
DD date