LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with While Loop

Hi this is my first VI in LabVIEW I am writing for an experiment at my school.

 

The idea is to read in data from the two DAQ assistants (one for RTD data and one for Acoustic Transducer data). There is one RTD that is submerged in liquid nitrogen and that is the only RTD I care to see what changes occur to. If this changes by a certain amount, given by the user, I want to save both the temperature and transducer data for that interval.

 

What happens is that the code does not register the change fast enough and does not save the data I am actually interested in. 

 

I have tried adding a part that takes the difference between the mean of the newest temperature taken and the last temperature saved to the array called "Target Temp." This seems to work for checking the temperature conditions, but does not help with when to save the data.

 

Please let me know if more information is needed. Thank you!

0 Kudos
Message 1 of 5
(1,443 Views)

Hi icewind,

 


@icewind26 wrote:

What happens is that the code does not register the change fast enough and does not save the data I am actually interested in. 


One DAQAssistent will need 5s to receive all requested samples, while the other one already finishes after 1s…

 

You will write better VIs when you use simpleDAQmx functions instead of using DAQAssistent, and your VI will perform better when both acquisitions will take the same amount of time to finish!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,424 Views)

@icewind26 wrote:

What happens is that the code does not register the change fast enough and does not save the data I am actually interested in. 

 


Unfortunately, we don't know what speed you expect and what data you are interested in. (And I don't have DAQmx installed, so I cannot inspect your assistant configuration, such as timing)

 

At this point I would recommend to step up from "Baby LabVIEW" (Mostly express VIs and dynamic data) and graduate to more explicit code. I see many questionable constructs, for example your "in place element" structure is just a glorified "replace array subset". Why is "target temp" even an array??? All you ever use is the first element. The loop counter indicator should be blue, not orange, right?

0 Kudos
Message 3 of 5
(1,422 Views)

Hi GerdW,

 

I initially tried using the DAQmx functions; however, the hardware I use for the RTDs does not allow me to set up an analog edge trigger. I will try this way and look for some work arounds. Thanks for the reply!

0 Kudos
Message 4 of 5
(1,402 Views)

Thanks for this. I think I needed someone to let me know what I was doing was not going to work. I have switched to using DAQmx functions and a while loop.

0 Kudos
Message 5 of 5
(1,334 Views)