LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with DAQ in while loop and Graphs

Hello,

I'm new here so I apologize if I posted this on the wrong board 🙂 

 

This is my "situation":

I need to make a simple PID controller which takes information (process variable) from an outside source (a NI's DAC connected through the USB port ) which is accomplished using NI-DAQ as an input, and the PID's output goes to the second NI-DAQ which is also connected using DAC to an actuator which in my case regulates the air pressure. (VI attached)

 

My problem is the following.

Both of the NI-DAQ I placed using DAQ Assist, require to be in a while loop.

-If I place them in separate loops, I have the problem of passing information between the Input NI-DAQ and the PID, and also between the PID and the Output NI-DAQ.

-If I place them both in one big loop, an error occurs saying that the selected buffer size is too small (Error -200609).

 

The timing settings for the DAQ's N samples, 100 samples to read at the rate of 1k (I also tried with Continuous samples and many different combinations of Samples to Read an Rate but without success).

Should I wire them with the same dt(s)?

 

 

The other thing I need to do (I'm also writing it here in order not to open new topics) is show the following 3 signals on a Graph (process variable (dynamic data type)(range 4mA - 20mA), PID output (double)(range 4mA - 20mA), and the Set Point (double)(range 0 to inf))

 

Firstly, is it possible to show the first two on a scale from 0 to 100 without changing the PID's output which needs to be 4-20?

Secondly, which graph should I use if I have different data types? (I tried the Waveform Chart, and succeeded in showing the first two; the third just messes everything up)

I would also have to make a legend explaining which signal is which (I see that this is possible with the Mixed Signal Graph).

 

I know this is probably too much to ask, but I'd be grateful for any help

 

Thank you in advance

0 Kudos
Message 1 of 3
(2,386 Views)

My problem is the following.

Both of the NI-DAQ I placed using DAQ Assist, require to be in a while loop.

-If I place them in separate loops, I have the problem of passing information between the Input NI-DAQ and the PID, and also between the PID and the Output NI-DAQ.

This is the best option---Use QUEUE or Functional global or something else to tranfer the data to and fro

-If I place them both in one big loop, an error occurs saying that the selected buffer size is too small (Error -200609).

Have you tried increasing the buffer? Is the acquisition happening parallelly (means to say the first DAQ not wired (error terminal) to second DAQ)


Regards
Guru (CLA)
0 Kudos
Message 2 of 3
(2,377 Views)
My problem is the following.

Both of the NI-DAQ I placed using DAQ Assist, require to be in a while loop.

-If I place them in separate loops, I have the problem of passing information between the Input NI-DAQ and the PID, and also between the PID and the Output NI-DAQ.

This is the best option---Use QUEUE or Functional global or something else to tranfer the data to and fro

 

How  do I make that QUEUE or Functional global?

 

-If I place them both in one big loop, an error occurs saying that the selected buffer size is too small (Error -200609).

Have you tried increasing the buffer? Is the acquisition happening parallelly (means to say the first DAQ not wired (error terminal) to second DAQ)

 

Well the buffer is, at least how I understood it, the option Number of Samples when in Continuous Samples mode. Concerning the parallel acquisition, do you mean I should wire the error ports of both of the DAQs?

 

 

 


0 Kudos
Message 3 of 3
(2,363 Views)