This is an old revision of the document!
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/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
IN | GLOBAL | value | W | Valore del dato da convertire |
IN | GLOBAL | index | L | Indice dell'elemento array dove iniziare il “deposito” del dato convertito |
OUT | ARRGBL | array | B | Array contenente il dato convertito (deve essere dichiarato con almeno “index+1” elementi) |
OUT | GLOBAL | errcode | F | Variabile che segnala un eventuale errore sulla funzione |
Errcode
Una volta richiamata la funzione, 'errcode' può assumere determinati valori, il significato di tali valori è riassunto di seguito:
0: Nessun errore
Esempio
Trasforma il valore -100 (signed word) in un valore binario
value = -100 index = 1 VR10SWrToBin (value, index, array, errcode) ;Sull'array si troverà : ; array[1] = -1 ; array[2] = -20