DaveLM
Member
Hi! I am trying to use a FOR instruction in Studio 5000 for the first time but can't figure out how to make it work as I'd like. The instruction is arriving at the terminal value nearly immediately after calling the FOR loop. I would like the FOR instruction to index only when the subroutine is complete.
I have a main routine with the FOR instruction calling a subroutine. My index tag data type is set to DINT, initial value =1, step size = 1. Terminal value is whatever (larger than 10). Any timer delays before or after the FOR instruction don't seem to affect the speed at which the instruction indexes. I also tried controlling the rung-condition-in to only be true after the subroutine is complete. No joy.
The subroutine has a sequencer moving from one rung to the next, basically it is toggling a string of lights in sequential order. I would like the sequence to be executed by the FOR instruction, so that the string of lights flashes "x" number of times.
Can anyone lend insight into this? What is the proper way to set up a FOR loop in Studio 5000? Outside literature is also welcome. I've read the programming manual and the instruction help in Studio 5000. Even the examples there haven't helped me understand.
Thank you for any insight!
Dave
I have a main routine with the FOR instruction calling a subroutine. My index tag data type is set to DINT, initial value =1, step size = 1. Terminal value is whatever (larger than 10). Any timer delays before or after the FOR instruction don't seem to affect the speed at which the instruction indexes. I also tried controlling the rung-condition-in to only be true after the subroutine is complete. No joy.
The subroutine has a sequencer moving from one rung to the next, basically it is toggling a string of lights in sequential order. I would like the sequence to be executed by the FOR instruction, so that the string of lights flashes "x" number of times.
Can anyone lend insight into this? What is the proper way to set up a FOR loop in Studio 5000? Outside literature is also welcome. I've read the programming manual and the instruction help in Studio 5000. Even the examples there haven't helped me understand.
Thank you for any insight!
Dave