10-13-2018 01:08 AM
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
10-13-2018 12:43 PM
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.
10-13-2018 02:06 PM
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
10-16-2018 12:48 AM
Unfortunately I cannot post the VI.
Can you please post an example of producer consumer loop to open and close the camera.
Jasraj Rajpurohit
10-16-2018 08:07 AM
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
10-16-2018 08:28 AM
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
10-16-2018 08:36 AM
Here is the VI backsaved to 2015 and a BD snippet:
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.