rs5000 simple SCL question

rscott9399

Member
Join Date
Aug 2017
Location
in space
Posts
114
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;
 
Last edited:

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...
Replies
18
Views
6,312
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"...
Replies
4
Views
3,192
I have recently made a career change after 25 years of being an electrician. I am officially a junior automation controls programmer. I recently...
Replies
11
Views
354
Hi Guys, Hoping that someone could please confirm if the 1756-IF16/B is/isn't compatible with the 1756-L1 5550 processor(13.24). I'm sure I...
Replies
2
Views
98
Hello, I need help making a logic modification to a RS Logix 5000 program. I can email the program and give plenty of insight to it plus I have...
Replies
4
Views
2,184
Back
Top Bottom