LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Camera Live mode in Event structure

I  am trying to build a VI using event structure in which camera can be opened and closed when needed. I have three mode Trigger, Live and images from PC. In trigger only one image will be taken and in Live mode the continuous images will be captured. I have 15-20 events in event structure for that camera will not be required. When I place Open camera.vi outside the event structure and camera is not connected then I am getting error camera not found in other events for which camera is not required.

As I know that while loop inside the event structure is not good choice to use. 

Kindly suggest the solutions for the following-

1. How to go Live in event structure?

2. How to open and close camera in trigger and live mode only?

 

Thanks 

Jasraj Rajpurohit

LabVIEW Developer 

Jasraj Rajpurohit
0 Kudos
Message 1 of 7
(3,489 Views)

Put the camera in its own loop separate from your event structure loop.  Then use the producer/consumer architecture where you a queue to pass messages to the camera loop to tell it when to open, close, capture.

0 Kudos
Message 2 of 7
(3,462 Views)

I don't see any reason why the Camera could not be included in the Event Loop.  However, as another contributor to this forum has noted in his Signature, it is difficult to tell what you are doing wrong in your code without you posting the code.  I agree with RavensFan that a Camera State Machine makes sense (I'm currently developing such an application), but one could use an Event Structure.

 

Post your code, and one of us will suggest how to fix it (I have a good idea of at least one mistake you are clearly making, but I don't like to guess).

 

Bob Schor

0 Kudos
Message 3 of 7
(3,456 Views)

Unfortunately  I cannot post the VI.

Can you please post an example of producer consumer loop to open and close the camera.

 

Jasraj Rajpurohit

Jasraj Rajpurohit
0 Kudos
Message 4 of 7
(3,423 Views)

Here is a simple VI that uses an event structure and a queue to send messages from a producer loop to a consumer loop. You could replace the "Do something" and "Do something else" cases with cases such as "initialize camera", "start live feed", or "close camera" where you perform the corresponding action. 

 

-Jordan

 

 

0 Kudos
Message 5 of 7
(3,407 Views)

Hi Jordan

I'm using LabVIEW 2015 so I am not able to open this file.

Can you please post a screenshots of the block diagram and front panel.

 

Thanks

Jasraj 

Jasraj Rajpurohit
0 Kudos
Message 6 of 7
(3,402 Views)

Here is the VI backsaved to 2015 and a BD snippet:

Simple event producer consumer_BD.png 

 

I want to point at that this is a very simple example, but hopefully something you could build on to do what you are trying to do with your camera.

0 Kudos
Message 7 of 7
(3,399 Views)