LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run a subvi and rest of the main vi together

I have a subvi for a Piezoelectric stage that does a scan of a surface. This vi takes about 1-5 sec to run depending on my input. Now, in the main Vi I want to have a Daq Assistant that would take data from a separate device (not the Piezo stage) only when the subvi is running. I don't need it to be highly synchronous. Only if I can make sure that the Daq assistant starts collecting data before the subvi starts, take data the entire time when the subvi is running and end after the subvi ends (let say about 100 ms off in time is fine.), works for me.

Hope I am able to clarify my problem. Can any one help with this? 

0 Kudos
Message 1 of 3
(2,231 Views)

You could either implement this as a state machine or an Event Structure by having a event being triggered once you have taken the measurement.  The Event Structure (and register Events) would be a better solution since the trigger would be set in a controlled manner... Although the same could be said with proper coding using a State Machine.

 

You can search for both state machine and event structure or register events within this forum and there may be some examples on the forum.  You can also look for examples in the Help menu.

0 Kudos
Message 2 of 3
(2,227 Views)

Strangly enough, the post immediately following yours talks about registered events..  Plus some images.

It will give you an idea..  Depending on if there is a mix in the main VI to include user/operator events, you may want to use a producer/consumer implementation.

 

http://forums.ni.com/t5/LabVIEW/Register-for-Events-Removing-Elements/m-p/2173938#U2173938

0 Kudos
Message 3 of 3
(2,225 Views)