Inhaltsverzeichnis

VR10SWrToBin

V = Variables

R = Reading functions

SIGNED WORD —→ BINARY

The VR10SWrToBin function Converts a Signed Word variable type (word with sign) in a Binary variable type.

IMPLEMENTATION

VR10SWrToBin (value, index, array, errcode)

Parameters:

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
IN GLOBAL value W Data value to convert
IN GLOBAL index L Index of the array element to start the “deposit” of the converted data
OUT ARRGBL array B Array containing the converted data (must be declared with at least “index + 1” items)
OUT GLOBAL errcode F Variable that indicates a possible error on the function

Errcode

After calling the function, 'errcode' can take certain values, the meaning of these values is summarized below:
0: No error

Example

Transforms the value -100 (signed word) in a binary value

value = -100
index = 1
 
VR10SWrToBin (value, index, array, errcode)
 
;On the array will be :
; array[1] = -1
; array[2] = -20

Note