From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

when i run my VI. it crashes after writing some .AVI file.

i am using the VI for image acquisition. when i run the VI, it crashes after writing some .AVI files.
Enqueuing and Dequeuing of data runs, but suddenly
Offset idicator stops at zero and it does not inrease
any more. i am posting two VIs. one i am using for image acquisition, enqueing image in a queue and then in another loop dequeue it and then write this with the help of AVI write function which is developed by
Alliance vision.
second VI i am posting so that you may understand how i am creating path.this Vi is just to create path.
my second question is that i want to stop two while
loops, one for Enqueuing and other for Dequeuing
same time with same stop button. butit does not work.
i
tried even with local variables. but it is not working.
any tips would be appreciated.
thanks
Download All
0 Kudos
Message 1 of 2
(5,954 Views)
I have a couple of suggestions for this issue:

1. Is not recommended to use IMAQ images with a Queue operation, the IMAQ image wire is the pointer to the memory place where the data is stored, so is not the actual data, for that purpose you may better use the array of data given by 'IMAQ Image To Array'. And the reason is that it can give bad behaviour since maybe you use the pointer of an image that has already been overwritten, so you pass bad or incomplete data.

2. The AVI utilities that I am aware of are NOT meant to be used in a live acquisition. The suggested operation from the companies that have developed those VIs is to save all your images to a folder, and then from a folder with images pass them to an AVI file in a separate operation. I would suggest
that you acquire your image in a ring acquisition (buffered) so you will make sure every single image gets saved. Afterwards, just make an algorithm that opens that folder and converts all the images in AVI.

3. As for stopping the two loops at the same time, you may want to run them in SubVIs as for separate threads, or use the queueing functions in the way it is described in the example program shipped with LabVIEW. Go to Help >> Find Examples >> Optimizing Applications >> Synchronizing Tasks >> QUEUE Basics Part I. In the block diagram check the Sub VI "Queue Consumer Producer" is on frame number 9 of the major sequence and in frame 1 of the small sequence embedded in that frame 9. That Sub VI (check block diagram) uses queue for running two loops and a special way of local variable. Just check it out.

If you have special requests for LabVIEW programming please post them to the LabVIEW section of DevExchange, and if you have special requests for IMAQ please post them in the Vis
ion section that will attract enthusiasts on each respective area.

Good luck!

Nestor S.
IMAQ/Motion Support
National Instruments
Nestor
0 Kudos
Message 2 of 2
(5,954 Views)