RSlogix 5000 reading\checking a bit of INT

mehrdad

Member
Join Date
Nov 2013
Location
canada
Posts
18
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.
 
Try TEST1. - the brackets are necessary. Make absolutely sure that 'i' is 0-31 or you'll have a fault.

Sorry, you said 'INT'. So that is '0 - 15'
 
Last edited:
wow it works now.
thanks for your help,
i wasn't assuming it could be this easy. this is my first project with Alan Bradley, i used to work with Schneider
 

Similar Topics

I'm creating an HMI project using Crimson 3.0. I saved my PLC project as a .L5K file and imported that into Crimson. It imported most of the...
Replies
1
Views
1,502
After learning here how to create arrays in RSLogix5000 ver 20.04, I have added some monitoring for a HMI to show 1 of 3 conditions for a bank of...
Replies
2
Views
2,047
Hello everyone, this is my first time asking for help here, so please bear with any problem my english or lack of experience can cause. i have a...
Replies
3
Views
2,687
I am a novice at using Excel to mine data from my PLC. It took me several hours to determine how to access an array in my PLC from Excel, so I...
Replies
1
Views
5,017
Hi, I am new to contrologix's. I want to read few bits of tag type real. Consider 'Out_real' tag declared as real. I want to read 14, 20, 31st...
Replies
8
Views
9,669
Back
Top Bottom