LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State machine architecture with 2 producers 2 consumers?

Hi,


I have 2 working Vi that are currently in 'sequence', like you can only execute the program once and it stops, that I want to change to State machine (or other mean) so you can execute them multiple times and close the Vi programmaticly when done. 

 

I attached simplified versions of those Vi current architecture. 

They both read and write frames from a camera to a file using producer-consumer. One with 1 camera and the other with 2. 

 

Searching the forums, I'm thinking I can use a state machine with a parralel consumer loop for the 1 camera Vi, as seen in this thread, third post : 

https://forums.ni.com/t5/LabVIEW/State-Machine-Data-Acquisition/td-p/3734333

 

But I don't know how to apply this to the Vi with 2 cameras. All the loops must run at their own speed in parralel while acquisition is in progress but the start and stop sequence affects both. 

 

Thank you, 

 

 

Download All
0 Kudos
Message 1 of 2
(2,064 Views)

Create your VI that handles the camera. Then in your main code use the "Start Asynchronous Call" to spawn as many camera processes you need. Use queues, a notifier or a user event to send messages to the camera tasks 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 2
(2,032 Views)