LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx event reference from subvi before it finishes

I have a VI that initializes two counters using the DAQmx drivers, waits in a while loop until the exit button is pressed, and then shuts them down.  I would like to alter the timing of these pulses which I can do just fine in a test VI, however when I use this as a sub VI in my main program I need to refference the DAQmx event.  I can't figure out how to get this refference to my main VI so I can call a propertiy node.   Does anyone know how to refference a DAQmx event outside of the VI it's created in?  The only solution I have is use two VIs and outout the event refference from the first so the main can use it. 

 

Hardware: PCI_6023E

DAQ_Test_Trigger_Outputs.vi works fine.

Ocean_TriggerSource.vi is the subvi in my main program.

counter.png shows where I'm calling Ocean_TriggerSourse.vi.  The cluster contains the refference to the stop button.

I have an event loop in the main VI that handles any user input while the program is running, and is where I would like to alter the counter properties.  

 

For the curious these counters are triggered on a pulse, then wait some amount of time (~1ms) before sending their own pulse that stays high for 1ms.  The trigger pulse is coming every 5ms.  I need to be able to exactly adjust each delay independantly while the program is running.  

 

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

This is my current work around

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

Have you tried using a call by reference node? Would this help your situation?

 

https://www.ni.com/en/support/documentation/supplemental/06/calling-a-labview-vi-by-reference.html

 

Eric Wang

Applications Engineering

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