From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, 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: 

2 while loops in the same VI? Error 250557

Solved!
Go to solution

Hi

 

I am trying to run 2 loops in the same VI. It's probably not the best way, but as a beginner this was the next logical to try to do what I'm trying to do.

 

I have a number of voltage and temperatures being read a certain rates (10Hz maximum for the temperatures, 1kHz for the voltages).

In parallel of this, I need to read a RPM sensor connected to a NI-9421 outputting the frequency.

The issue is that, this frequency is relatively low (lower than the rate at which I am reading everything else).

 

What I had before attempting to run 2 loops:

 

I initially had the task for the RPM sensor in the main loop and it worked alright at higher speeds, but would miss a lot of reading at lower frequencies. My best guess is I am reading this RPM sensor task too often. As a result, there will be instance when the Read will return nothing. Causing 0's get filled in the array that's collecting the data. Detecting and removing those zero's could work but there would be instances where I would like to see those zero's (for example to detect problem with the apparatus we're working with).

 

Anyway, that's how I got to trying to run 2 loops. After trying that, I did some searches and a few instances where it had been done and generally the advice was to insure there was no dependencies between the 2 loops which I think I was able to do.

 

I know I only provided 2 screenshots, which won't necessarily be sufficient to help, but I think I'm mostly looking for some advice on a better strategy to employ here.

 

thanks

 

 

 

swiftmoun_0-1702886337367.png

 

 

swiftmoun_1-1702886393900.png

 

 

0 Kudos
Message 1 of 3
(8,820 Views)
Solution
Accepted by topic author swiftmoun

Hi swiftmoun,

 

do what the error message says: set the DAQmx task timing parameters before you start the DAQmx task!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(8,795 Views)

I feel so dumb, thank you!

0 Kudos
Message 3 of 3
(8,729 Views)