INTTOBIT (130)
INTTOBIT (130)
ID 130
Application: |
PLC |
SIM |
Group: DATA CONVERSION
Short description:
Function that converts an integer value to binary.
Inputs (1):
no. |
type |
impulse |
mark |
notes |
1 |
I |
no |
IN |
Integer type input value (0...255) |
Outputs (8):
no. |
type |
impulse |
mark |
notes |
1 |
B |
no |
OUT1 |
Output bit no. 1 (oldest bit) |
2 | B | no | OUT2 | Output bit no. 2 |
3 | B | no | OUT3 | Output bit no. 3 |
4 | B | no | OUT4 | Output bit no. 4 |
5 | B | no | OUT5 | Output bit no. 5 |
6 | B | no | OUT6 | Output bit no. 6 |
7 | B | no | OUT7 | Output bit no. 7 |
8 | B | no | OUT8 | Output bit no. 8 (youngest bit) |
Settings: none
Function operation:
The INTTOBIT function converts an integer value to binary. Values above 255 are not converted (all outputs have a value of 1). Example conversion for IN = 5:
OUT1 |
OUT2 |
OUT3 |
OUT4 |
OUT5 |
OUT6 | OUT7 | OUT8 |
0 |
0 |
0 |
0 |
0 |
1 | 0 | 1 |
R registers and M markers used: none