From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

DAQ PID

Hi, I'm using LV 2019, USB-6341 and this VI:

 DAQAssistant PID.png

By converting DDT to Scalar the output from PID looks like this:

Przechwytywanie2.PNG

My question is how to convert DDT to get output from PID without any data lost. Or maybe there is other way to use PID for DDT?

Thanks in advance for help 😉

0 Kudos
Message 1 of 4
(2,403 Views)

Hi Jakub,

 

all your terminals miss their label - why do you hide them? (And why don't you use more descriptive labels?)

 


@Jakub8888 wrote:

get output from PID without any data lost.


You don't lose any data from PID output, but you lose them at the PID input due to the coercion dot…

 

The PID expects a scalar DBL input, so you could convert your DDT wire to DBL.

But then you would throw away 999 of the 1000 samples you are reading per iteration, but there are several options:

  • change the DAQAssistent to read 1 sample at 100Hz, then use FromDDT to convert to DBL…
  • don't change the DAQAssistent, but use FromDDT to convert to an array of DBL. Then take the mean of that array…

In general I suggest to use plain DAQmx functions instead of the DAQAssistent!

Best regards,
GerdW


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

Hi, thank you for your response. 

 


@GerdW wrote:

You don't lose any data from PID output, but you lose them at the PID input due to the coercion dot…


Yes, I know about that, I just misspoke. 

I tried your solutions and got the following error:

Przechwytywanie3.PNG

That's probably because I need to acquire at least 200kS/s, otherwise my reading is useless.

Is there any solution for that?





0 Kudos
Message 3 of 4
(2,304 Views)

@Jakub8888 wrote:

That's probably because I need to acquire at least 200kS/s, otherwise my reading is useless.

Is there any solution for that?






Use a FPGA?

Running a loop at 200kHz on Windows whilst doing calculations is probably unrealistic, and updating an output at that speed seems unlikely. Certainly having reliable timing for a loop at 200kHz is impossible.

On FPGA, this becomes quite a bit more straightforward.


GCentral
0 Kudos
Message 4 of 4
(2,290 Views)