LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Iterate through a cluster of errs so I can implement my guard clause in my state machine

Solved!
Go to solution
Solution
Accepted by topic author alex_b2

@alex_b2 wrote:

The reason I want to have the camera on an independent loop is so that I see something even when I am in the wait state or some other event which takes a while to complete. 🙂


You want to do two things with the Image -- view it, and save it.  The Producer acquires the Image, which takes a little time.  The Consumer saves the Image to disk (which may also take time, depending on the size (in bytes) of the Image and the speed of your File I/O device.  But wait, there's a third thing you want to do -- view (as it is being acquired) the Image.  You can probably do that safely in the Producer loop.

 

Think about what happens in the Producer Loop.  You set an acquisition speed for the Camera (let's say 30 fps).  When you run the code, you should be able to time how long it takes to acquire 300 frames -- it should be 10.0 seconds.  Now, the Producer Loop is "clocked" by the camera to run at 30 Hz.  The Image display should be capable of at least 60 Hz, so it should easily "fit" inside the Producer Loop.  But it if doesn't, you can simply create a second Consumer that handles the viewing of the Image.  One Producer which produces 30 Images per second, sending all of them to Consumer "Image Viewer" and only the ones you decide to save to "Image Save-to-disk".

 

[Note -- I didn't think of the idea in the previous paragraph until I was finishing the paragraph preceding it].

 

Bob Schor

0 Kudos
Message 11 of 12
(80 Views)

HI Bob,

 

Thank you for your input. I am clearly a beginner and it seems as though I should rethink. It had not occured to me to use a second consumer loop. 

 

You are correct that I do not need many fps. 30fps will be more than enough.

 

Thanks to everyone who has put me on the right path.

Alex

0 Kudos
Message 12 of 12
(67 Views)