LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to sequence events

From my code graphic I need the closed limit switch to do all the tasks that are attached to it but I want to be able to have one task always performed last, and that is the step count to be set to 0. right now the step counts gets set to 0 and nothing else happens (because of the step count being 0).

How to I sequence this?
Ron
0 Kudos
Message 1 of 3
(2,582 Views)
This is tricky without seeing the logic in the rest of your code. I'd suggest a sequence structure - put whatever you want Close Limit to do first in frame 0. Then put Select in frame 1. Use sequence locals to pass any parameters from frame 0 to 1.

There's probably a more elegant way of doing this, but it's difficult to know exactly what, as the diagram is incomplete.

Rupert
0 Kudos
Message 2 of 3
(2,582 Views)
The image that you supplied was rather fuzzy and didn't really show all of the logic. I have found that there are two primary ways to perform sequenced tasks without resorting to the sequence structure which reeks havok on the dataflow in the diagram (when you use sequence locals you have to break the left to right dataflow guidelines). One simple way is to make each task into a subvi and link the subvis together, passing error clusters through them in order to control the order of operation. This method works well when the tasks will always be performed in a particular order. The second method is to use a state machine approach. You can find a basic state machine example in the LabVIEW examples.
0 Kudos
Message 3 of 3
(2,582 Views)