LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Preventing DAQ from tripping: need to set range (min, max) for signal output to 0 to 5

Hello! I'm a beginner in LabVIEW trying to prevent my DAQ  Assistant from tripping when I run my VI. I need to set up my signal so that only values between 0 and 5 are inputted to the DAQ. The signal type is dynamic data. What would be the best way to do this?

 

0 Kudos
Message 1 of 6
(180 Views)

Hi asb,

 


@asb328 wrote:

What would be the best way to do this?


The best would be to delete the DAQAssistent and all DDT wires…

Read this and use plain DAQmx functions instead!

 

Once you use either scalar samples, sample arrays or waveforms you could use an InRangeAndCoerce function to limit the sample values.

Or you prevent "out of range" values already upstream in your data generation routines…

Best regards,
GerdW


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

Hi GerdW,

 

Thank you for your response! Is there a way to work with the DAQAssistant and coerce the values to stay between the 0 and 5 range? The same signal is being wired to other parts of the VI where dynamic data works fine. This signal is also part of a number of other signals outputted from the DAQAssistant. Removing the DDT wires and DAQAssistant would be difficult at this stage.

0 Kudos
Message 3 of 6
(149 Views)

I tried changing the DDT to an array, then using inrange and coerce, then converting back to DDT. But that doesn't work and I'm unsure of why.

0 Kudos
Message 4 of 6
(142 Views)

Hi asb,

 


@asb328 wrote:

But that doesn't work and I'm unsure of why.


Me too.

(Maybe because you forgot to attach your code…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(107 Views)

The code is proprietary so unfortunately I cannot share it. I was able to use the method described above to fix it, I just needed to adjust the final step to set the correct input signal type in change to DDT.

0 Kudos
Message 6 of 6
(54 Views)