I have to write some rslogix 5000 code that will loop through an array, copy each element in the array one at a time to a separate tag and set a bit to true. Then i want to start a timer. when the timer is done, i want to set the bit to false.
the problem is that the loop that i have is incrementing but the code inside is not executing once for each time the loop counter increases.
the code looks like this:
the problem is that the loop that i have is incrementing but the code inside is not executing once for each time the loop counter increases.
the code looks like this:
Code:
for iLoopCounter:=0 to 20 do //iloopCounter is an int
COP(arrayOfStrings[iLoopCounter], singleString, 1);
startBit:=1;
testTimer.reset:=0;
testTimer.acc:=3000;
testTimer.DN:=0;
testTimer.TimerEnable:=1;
tonr(testTimer); //start the timer.
if testTimer.DN then
startBit:=0;
end_if;
end_for;