LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change the current value while program is running?

Function of our program is to inject a current into a resistive material and to measure voltage across it. From these values, resistance is calculated.

How do I modify my program such that when my measured voltage is out of the range,the input current value will change accordingly until the measured voltage is within the range (eg range : 0.1 to 5V).
0 Kudos
Message 1 of 2
(2,652 Views)
Have a set of two - five ranges.
Each channel should have a variable that sets its preferred range. Of course you don't know that variable the first time thru, but the next time thru, unless the value varies widely, you're already on the right track.

For each channel:
While (Not In Range)
Current out = Preferred Range [chan]
V = read voltage
if (V > Vmax)
Not In Range = true
Preferred Range [ chan ] = Preferred Range [ chan ] -1
if (V < Vmin )
Not In Range = true
Preferred Range [ chan ] = Preferred Range [ chan ] +1
if (Preferred Range [ chan ] < MinRange or Preferred Range [ chan ] > MaxRange)
error - resistance out of range
} en
d while (repeat if Not In Range)
} end for (next channel )


That's assuming you're doing a single channel - if you're doing a scan, just scan all channels, check all channels for out-of-range values, adjust output ranges for those that need it, and re-scan until all channels are in range, or you run out of ranges (error).

Bes sure to allow for settling time of the current output device.

HTH
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 2
(2,652 Views)