BOOL tag not expected in expression

HeadlessEng

Member
Join Date
Jul 2019
Location
Ireland
Posts
6
Hi guys
First time using RSLogix Structured text(Studio 5000) so bare with me.
What im trying to achieve is the ability to monitor which bit is active in a Boolean array so I can display it on a HMI.

BOOL[96] copied to TESTARRAY[2] (DINT) in a ladder routine.
ST used to go through TESTARRAY[0] to determine if any bit is on.
There can only be active 1 bit on at a time due to the way the main program is setup.

Code as follows:
for i := 0 to 31 do;
if TESTARRAY1[0]. = 1 then;
IGNITION_INC := i ;
end_if;
end_for;

Problem lies in the 2nd line, I'm getting an error say ''TESTARRAY[0].': BOOL tag not expected in expression.' Considering the tag is a DINT I don't understand why its giving me the error.

I haven't been able to find any solution online and I'm not sure if I'm even going about it the right way so hopefully someone can explain what I'm doing wrong.
TIA
HeadlessEng
 
Hi guys
First time using RSLogix Structured text(Studio 5000) so bare with me.
What im trying to achieve is the ability to monitor which bit is active in a Boolean array so I can display it on a HMI.

BOOL[96] copied to TESTARRAY[2] (DINT) in a ladder routine.
ST used to go through TESTARRAY[0] to determine if any bit is on.
There can only be active 1 bit on at a time due to the way the main program is setup.

Code as follows:
for i := 0 to 31 do;
if TESTARRAY1[0]. = 1 then;
IGNITION_INC := i ;
end_if;
end_for;

Problem lies in the 2nd line, I'm getting an error say ''TESTARRAY[0].': BOOL tag not expected in expression.' Considering the tag is a DINT I don't understand why its giving me the error.

I haven't been able to find any solution online and I'm not sure if I'm even going about it the right way so hopefully someone can explain what I'm doing wrong.
TIA
HeadlessEng



Don't look at bits, if a DINT tag is not zero, you have at least one bit on.


I've seen a "bit-hack" that can tell you which bit. I'll see if I can find it.
 
Last edited:

Similar Topics

Hello Guys, I've got a problem of using RSLogix Data Table Object to write BOOLEAN type of value. For SINT, INT, DINT, I can use following...
Replies
1
Views
4,051
I received the following message via PM, and am posting here publicly to help others. ============================================ I had a...
Replies
10
Views
1,015
Greetings. I have a 1769-L30ER that runs a new piece of equipment my company bought. I would like to read from and write to some tags on this PLC...
Replies
7
Views
1,426
I need to move a large Bool array to Word array in Schneider Control Expert. Is there an easier way to do this? For example: Bool[128] array to...
Replies
4
Views
1,343
I work at a cheese factory and we recently ran into a problem where in an older controller they where able to use a REAL Data type in OTU and XIC...
Replies
13
Views
2,581
Back
Top Bottom