LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

imaqdx video saving with on off boolean switch

i'm having issues saving the video stream using a boolean switch. the main code this runs in is in an always on state so the video feed will always be displayed but the ability to record and save videos will be the state on a boolean switch. im very new to using case structures and im not entirely sure how to make the file close and save after the switch is set to off again.

Download All
0 Kudos
Message 1 of 5
(782 Views)
The case structure will be entered into 1 time. If "Boolean" is true, you will enter the true case. It will run the "while loop" one time and then stop (because "Boolean" is true).
You may not care, but the "Image" data type is one of the few reference data types in LabVIEW. This means there is a buffer holding the image and if you write to the buffer in one loop, and read from it in another loop, the actual data that is read will depend on when those write and reads happen in relation to each other.
0 Kudos
Message 2 of 5
(762 Views)

how would i fix this so the loop will continue to go while the switch is on and true

0 Kudos
Message 3 of 5
(760 Views)
Put the loop outside the case structure, and do not stop the loop based on the same condition as the case structure.
0 Kudos
Message 4 of 5
(754 Views)

@Gregory wrote:
You may not care, but the "Image" data type is one of the few reference data types in LabVIEW. This means there is a buffer holding the image and if you write to the buffer in one loop, and read from it in another loop, the actual data that is read will depend on when those write and reads happen in relation to each other.

You absolutely should care because (depending on your Frame rate and other considerations) the Images you save may have rather little resemblance to the "Image" that you view in the Display Window inside the Acquisition Loop.  Ordinarily, you would use a Queue or Stream Channel (yay!) to create a Producer/Consumer design that lets the Consumer "lag" the Producer, at least initially, and "catch up" without missing any data, but since what you are passing is the address of the Image Buffer in LabVIEW, if you've only allocated a single buffer, you are always passing the same thing in the Stream, so it will show whatever is in the current buffer.

 

Needless to say, learning how to handle images and buffers was one of the more confusing and challenging aspects of learning how to use IMAQdx to save streaming videos.  I'm grateful I'm not doing that these days ...

 

Bob Schor

0 Kudos
Message 5 of 5
(715 Views)