Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit the range

Hi to all,.
 
I apologize if my English is no so good, I hope it's good enough to explain my problem.
I'm quite new to both NI boards and Measurements Studio: I searched in past threads without find a complete answer to my questions.
 
I have a PCI-6229 DAQ board configured by MAX. Then, I acquire data with Visual Basic .NET. We're speaking about analog input tasks.
 
My question is: how to actually limit the input range of measured data (possilby in MAX)?
I know I can define the input data range but the actual values may change a little either over or under these limits. I need a sort of "clamping" so if I set say 5V as maximum allowable value and the board read 5,01V I want to read 5V.
 
Currently I achieve this in my software with several if..then statements for each analog input:
 
[pseudocode]
if readvalue > MAX then outputvalue = MAX
elseif readvalue < MIN then outputvalue = MIN
else outputvalue = readvalue
 
However, I'm wondering if I can setup MAX to do this automatically.
 
Thanks for any answer.
Marco Trapanese
 
--
Femtotech
0 Kudos
Message 1 of 3
(3,158 Views)

Dear Marco,

Actually what are you seeing is expected behavior. DAQ driver allows a little "over measure",  usually this feature is great for troubleshooting purposes.
Looks like you found a viable solution in Visual Studio.

Altough I'm not a Visual Studio Guru, I'm quite confident you can find some kind of array threshold funtion to get an easier solution.

have a good day.

 

 

FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
0 Kudos
Message 2 of 3
(3,143 Views)
I read the 'input range' setting actually doesn't limit in anyway the output values. It just set the closest ADC range. Am I wrong?

However, I need to
exactly limit the output range so I will look at a convenient solution in .NET, as you suggested.
Thanks

Marco
0 Kudos
Message 3 of 3
(3,117 Views)