LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

More cycle problems

I've run into a problem, I need to hook up the 'S' of a select (For step count) to the Close Limit switch so that when it is closed the value resets to 0 but I get a cycle problem when I attempt this, I don't know of any other way to hook this up.

Any help?
Thanks

I've attached my code graphic below.

Ron
0 Kudos
Message 1 of 4
(2,575 Views)
Yes, you simply need to feed it into the shift register so the change is maintained between calls. I have dropped some hits on your graphic, let me know if this is clear enough. (Add the S terminal as indicated in yellow, remove wires marked in red, and add wires marked in purple (they will be blue, of course)).
0 Kudos
Message 2 of 4
(2,575 Views)
I made the changes as you had mentioned but I still get the same problem, the wire between the 'S' and the limit switch is broken due to a "member of a cycle". It also breaks the other wires in the while loop as well, I guess they too are part of the cycle.


Ron
0 Kudos
Message 3 of 4
(2,575 Views)
You are creating a deadlock between the two loops because there is data dependency both ways. The upper loop cannot start until the lower has finished to provide the the value for "Close limit", but the lower loop cannot start because it requires inputs from the upper loop. Catch 22!

You need to find a better solution. A quick a dirty fix would be to use a local varable of "Close Limit" in the upper loop and remove that wire dependency.

A better solution would be a bit more radical: All your loops run only once and the only purpose for their existence are the uninitialized shift registers.

Put the entire code in a single loop containing all shift registers and get rid of all the individual looplets. (If you want, you can then even ri
ght-click on all the shift registers and convert them to feedback nodes).
0 Kudos
Message 4 of 4
(2,575 Views)