LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with avi recording and parallel while loops

Hi,

I made a test-VI which captures my webcam and save it to an AVI. (based on a sample I found somewhere)

lv_avi-recording.png

This works pretty fine so far (except the fact that the "frames per second"-constant has no effect and I am not able to change the resolution, but that's not the problem).

 

I have a VI which controls some hardware and I want to record this with the webcam. For testing I made a dummy-VI which should run in parallel with the VI above:

lv_avi-recording_2-while-loops.png

The 1st while loop should capture the webcam.

In the 2nd while loop is a dummy-VI which generates some random values and waits 5000ms (to simulate the hardware).

The problem is that those while loops do not work in parallel. When the execution is finished I get an AVI-file which is about 100ms long (so I guess it captures just 1 frame).

If I replace that whole dummy-VI thing with a stop button it works nicely, but if I try to use a "Wait (ms) Function" or a "Wait Until Next ms Multiple Function" the video is always just about 100ms.

 

Any idea how to implement multitasking or maybe even multithreading ?

0 Kudos
Message 1 of 3
(2,627 Views)

Hi Chris3,

 

Just a random suggestion but have you tried removing the sequence structure? You can wire the error cluster from the IMAQdx Configure Grab.vi to both of the VIs for it to start parallely. 

 

If you put it in a sequence like that, it is most likely that the middle sequence has to complete execution before it can go to the next sequence but it couldn't because of the wait.

 

Let me know how it goes.

 

Warmest regards,

Lennard.C

 

 

Learning new things everyday...
0 Kudos
Message 2 of 3
(2,565 Views)

My guess is that the Input array is empty so the lower loop executes 0 time, and then activates Stop.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 3
(2,558 Views)