LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am still trying to get two funtions to run AT THE SAME TIME within my vi, but to no avail.

I am trying to capture a signal with a daq card (PCI-MIO-16E-4) WHILE I have a picture box switch back and forth between grey levels. It is absolutely necessary that they both happen simultaneously, but what is happening is that the picture box stops switching while the DAQ is capturing the signal. Can someone take a look at this and offer some suggestions, or just see if you can get this thing to work. The vi is simple and should be straight forward, right? I have had some suggestions on a previous fishing expedition, but none worked. If you try this vi, set the scan rate to 5000, and the # of scans to 15,000. P.S. I am running labview 6.1 if that makes any differenc
e. Thanks for your attention.
0 Kudos
Message 1 of 4
(2,674 Views)
Try using the DAQMx VI's instead of the traditional DAQ VI's.

AI Read is notorious for "soaking up" computing resources because it locks everything while waiting for the DAQ buffer to fill. There are several work-arounds to this problem, DAQ Occurances to name one. None of them is as simple as DAQMx.

If you must use AI Read, search the Example Programs database for asychronous AI Read or DAQ Occurances.
0 Kudos
Message 2 of 4
(2,674 Views)
Hi Planar,

You have been trying hard!

I am not sure the following will help, but I would like you to try it out.

I have restructured your code to help reduce the work that is done while data is acquired.

1) I "pre-compute" the pictures at app start-up. This way only the pictures need updated and the pictures are rendered repeatedly.

2) I moved your config up front so it does not run while the flickering is going on.

3) I add a check of the backlog from the DAQ that looks at the number of scans waiting in the buffer WITHOUT reading the data. Only when the requested # of scan are ready is the data read.

4) While waiting for the buffer to fill, the daq loop will execute a wait, thereby freeing CPU for the flicker tasks.

Your code, w
ith my changes is attached (in LV 7.0).

A jpg is included for non-LV-7.0 readers.

Yes, the code is sloppy! I am woring fast and for free!

No, I do not have DAQ hardware to test so it may NOT work right out of the box.

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 3 of 4
(2,674 Views)
After some coffee I realized I missed two other things.

5) Writing to FP indicator takes time. Toss "data3"!

6) Writing to file also demand CPU to convert and format the data. Move the file writing till after the flickering is done. (For the time being can we skip the file writing? How about just deleting the file write until we have the flicker working. We can save the data in a shift register and write later).

BTW
How fast is your CPU?

How much memory?

Still trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(2,674 Views)