rs5000 simple SCL question

I am having difficulty doing something i do in every other plc without a problem

I have created an SCL AOI.

I have an integer input to it. Lets call it "BITS"
for now. obviously bits has the following components
BITS.0
BITS.1
BITS.2

etc etc etc


i then write the following in the script

IF BITS.0 = TRUE THEN
DO SOMETHING
END_IF


Thats all i have done.
Nothing special, just typical bit access of an integer.

All im getting is compile errors and i dont get why.

Anyone with any ideas

the compile error im getting is

'BITS.0': BOOL tag not expected in expression.
 
There are only a few pre-defined tags in ControlLogix, mostly things like the "S:FS" first scan bit. There are no named constants.

"TRUE" is a valid name for a user defined Tag of any type. So is "FALSE". That's why Studio 5000 objected to your using them. And the "=" operator does not accept boolean arguments.

In structured text, a BOOL tag or a bit sub-element of a tag is a standalone True or False condition just by naming it.

Code:
If MyIntTag.0 Then
YourIntTag := 1;
End_If;

If not(MyIntTag.0) Then
YourIntTag := 2;
End_If;
 

Similar Topics

So i am a EE and mostly work in protections. I recently got thrust into more of a controls roll and need to start learning some logic. What...
18
Replies
8,915
Views
I'm lookin for help with a simple 3 axis or even 2 axis servo logic(control logix) for making 4, 3" holes one at each corner and then a 2" x 2"...
4
Replies
3,980
Views
I need to get RS5000 for compact logix for personal use,(home learning). Are there any options besides being R***PED by A-B for a yearly subscription?
6
Replies
689
Views
Hi, I'm looking for help to resolve an issue. I have a PowerFlex 755 at port 0, with a 20-HIM-X6 at port 1, a 20-COMM-E at port 5, Ethernet/IP at...
4
Replies
1,474
Views
I have recently made a career change after 25 years of being an electrician. I am officially a junior automation controls programmer. I recently...
11
Replies
1,651
Views
Top