HeadlessEng
Member
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
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