gbautomazione
Member
Good morning everybody.
I have a 5380 ControlLogix with motion and safety and I'm having some issues with a continuous task and for loop (structured text):
I have 100 temperature probes and a cumulative bool signal that must be 1 when all temperatures are in a setpoint range.
I'll explain with some code:
In the same program I have these subroutines:
In a subroutine I have:
In another subroutine I have a ladder program that checks temps_all_ok like this:
sometimes I find step[1] and step[2] latched simultaneously..
It's possible that one routine overlaps the other?
If I put my code in a periodic task >= 10ms the program is working correctly...
I can't figure out what I'm missing.. Maybe the for..loop is not correct?
Thanks for any help
I have a 5380 ControlLogix with motion and safety and I'm having some issues with a continuous task and for loop (structured text):
I have 100 temperature probes and a cumulative bool signal that must be 1 when all temperatures are in a setpoint range.
I'll explain with some code:
In the same program I have these subroutines:
In a subroutine I have:
Code:
temps_all_ok := 1; ////----- this was missing
FOR count:= 1 TO 100 BY
1 DO
if temp[count] < setpoint then
temps_all_ok := 0;
exit;
end_if;
END_FOR;
In another subroutine I have a ladder program that checks temps_all_ok like this:
auto_on step[0] step[0]
----| |--------------| |----------------------|----(U)----|
| step[1]
|----(L)----|
temps_all_ok step[1] step[1]
-----| |---------------| |--------------------|----(U)---|
| step[2]
|----(L)---|
sometimes I find step[1] and step[2] latched simultaneously..
It's possible that one routine overlaps the other?
If I put my code in a periodic task >= 10ms the program is working correctly...
I can't figure out what I'm missing.. Maybe the for..loop is not correct?
Thanks for any help
Last edited: