Help in VB to PG code
The interlock signal (boolean) are converted to Integer at PLC program and the individual Bit status (boolean) are display at HMI using the following VB code,
"BitStatus = 2^bitno AND Input"
BitStatus = boolean data type - to indicate the bit status of the input "bitno"
bitno = Integer data type - which points the bitno of the packed integer input
Input = Integer data type - (boolean) packed integer input
The same code can't be used and I couldn't get an equivalent function code in PG.
Can anyone help ?
If you want to use a specific bit from an integer to evaluate to a boolean in a PG2 expression you could simply do this
where MyPackedInteger= an integer value
n= the bit number you want to evaluate to a boolean. 0 = the least significant bit.
Actually much simpler than the VB code
Hope this helps