LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State Machine Project - DAQmx, Error Handling, Stop

Hi together,

I am currently working on a project containing a state machine structure with DAQmx measurements and multiple while loops with notifies and queues used to pass information.

The aim is to measure signals continuously in 2 different loops (1&3), saving the data in loop 4, and performing PID control in loop2.

Good news first, the program runs for now (ignoring the PID part). However, while measuring the voltage signals I keep getting "NaN" values every now and then. That is one of the problems a am stuck with.

 

Also I am looking for a way to stop the program from the front panel. I tried using notifiers, however, I get an error "Error 1 occurred at Release Notifier in regelung.vi" when pressing the stop button.

It would be nice to introduce a good error handling of the notifiers/queues in combination with the stop conditions, but I don't really know how to realize this.

 

 

Thanks a lot for any advices!!

Regards

Jack

 

 

Download All
0 Kudos
Message 1 of 5
(2,524 Views)

Update: The idea of using notifiers finally worked, I simply released it although I still "needed" the notification for another loop plut I forgot a timeout.

Stop-problem solved 🙂 However, I still get NaNs during the measurement...

0 Kudos
Message 2 of 5
(2,514 Views)

Hi,

 

NaN is returned for example when you do a sqrt of a negative number.

in the standard deviation.vi there is a squareroot, but as far as i see your not useing it...

 

This VI returns NaN for the mean output when the array is empty.

 

nan.png

 

(this VI returns NAN)

 

I think you might want to check on that.

0 Kudos
Message 3 of 5
(2,481 Views)

Thanks for the answer.

I understand that the NaNs result from an empty array.

My question is why the array is empty.

I think this is a timing issue. I set the buffer size for now to 500 and also set the number of samples per channel in the read.vi - still getting NaNs Smiley Sad

 

Thanks for any hints.

0 Kudos
Message 4 of 5
(2,467 Views)

Hi, try wireing a Number of hown many samples you want to aquire to the read VI, also you have the timeout unwired. The default timeout is 10 seconds. when no samples are read within 10 sec, you will get a empty array.

0 Kudos
Message 5 of 5
(2,436 Views)