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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I still acn't get my picture box to flicker between two grey levels WHILE the DAQ takes a measurement.

I received a suggestion that I contain the two parts (grey level ficker and signal capture) in seperate while loops and use a local variable to pass a control to the measurement part from the flicker, with the control triggering the true statement of a case structure inside of the measurement while loop. In each of the cases (both vi's are listed below) the picture box stops swithing between the two grey levels while the measurement is being taken by the DAQ. In my application, I have a photometer taking continuous measurements and sending a proportional voltage signal to the DAQ input. If the picture box (which is what the photometer is measuring the br
ightness of) does not switch back and forth between the grey levels while the DAQ is sampling the incoming signal from the photometer, then the photometer is putting out no signal. No grey level switching, no signal. So the DAQ ends up measuring a flat line. Does anyone have any ideas as to how I can fix this, please try nd run my vi's before you make suggestions, just to see what is happening. Also, if you have a solution, give it to me in remedial form, if you can. I am new to labview.
Thanks for all your help.
0 Kudos
Message 1 of 6
(2,411 Views)
In neither of your examples do you have two separate while loops. On the diagram, create a while loop. Drag the daq case statement into the second while loop.
0 Kudos
Message 2 of 6
(2,411 Views)
I apologize, one of the vi's that I sent was incorrect. I did, more or less, the same as the example you gave me. Like the example you gave me, it stops switching between grey levels momentarily while the DAQ captures the signal. Is it possible to have the two run simultaneously? I will attch the vi that I intended to send, and would appreciate any further ideas you may have on how to fix the problem.
0 Kudos
Message 3 of 6
(2,411 Views)
I don't have any daq hardware installed and so I can't judge the "momentary" pause. One thing that I would recomend is putting the AI Config, AI Start, and AI Clear outside the while loop so that the only thing inside is the AI Read. Putting a small delay in each while loop might also help. Daq runs at a pretty high priority so there may be a limit to actual simultaneous running short of moving to LabVIEW real-time.
0 Kudos
Message 4 of 6
(2,411 Views)
I tried removing all but the AI read from the while loop, but the result is the same. I may have incorrectly described the "momentary" pause in picture switching while the DAQ is capturing the signal. The picture stops switching for the entire time, or very nearly so, that the DAQ is capturing a signal. So if you were to set the san rate at 5000 and the # of scans to capture at 15000 you could easily see that the picture stops switching for about three seconds. Add more to the # of scans and you can count longer while the picture box stops switching. Unfortunately I need at least three cycles at 1 Hz. for my application. I also need a scan rate of no less than 5000 S/s
0 Kudos
Message 5 of 6
(2,411 Views)
I think what you're seeing is a limitation of NI-DAQ. DAQmx came out with LabVIEW 7 and there are a lot of improvements. The only computers I've got with a daq board are pretty busy right now so it might be a while before I can run your program and confirm that DAQmx fixes your problem. I'll get back to you when I can.
0 Kudos
Message 6 of 6
(2,411 Views)