Hi,
if we want to read or set a bit of an integer we can simply do:
assume TEST1 is the integer,
TEST1.3 := 1;
or
IF TEST1.4 THEN.....
but what if i want to check an undetermined bit, e.g. TEST1.i
FOR i:= 1 TO 16 DO
IF TEST1.i THEN ....
this doesn't work. it doesn't work in other PLC softwares either, but there are functions for this purpose in other PLCs. for example in Schneider's unity we have GET_BIT
e.g. CurrentState := GET_BIT(InputRegister, BitNumber);
how can i do this in RSlogix 5000?
I would very much appreciate it if you could help me with this matter.
if we want to read or set a bit of an integer we can simply do:
assume TEST1 is the integer,
TEST1.3 := 1;
or
IF TEST1.4 THEN.....
but what if i want to check an undetermined bit, e.g. TEST1.i
FOR i:= 1 TO 16 DO
IF TEST1.i THEN ....
this doesn't work. it doesn't work in other PLC softwares either, but there are functions for this purpose in other PLCs. for example in Schneider's unity we have GET_BIT
e.g. CurrentState := GET_BIT(InputRegister, BitNumber);
how can i do this in RSlogix 5000?
I would very much appreciate it if you could help me with this matter.