Hello,
I am a student doing a project at my university.
I need to make a simple PID controler which takes information (process variable) from an outside source (a NI's DAC connected through the USB port ) which is acomplished 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. (I could send the .vi file, but I am new here and do not know how to attach it)
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-20mA?
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 because of the range)
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
|