09-08-2016 06:10 PM
I'm trying to use a custom scale (linear) for a few of the channels I'm reading in from a USB-6009 in c#. All of the examples I find are in labview. I've written the code but only seem to get the prescaled values to save. Any help would be greatly appreciated.
private LinearScale myCustomScale;
double scale_m = 60;
double scale_b = -150;
myCustomScale = new LinearScale("CustomScale", scale_m, scale_b);
myTask.AIChannels.CreateVoltageChannel("Sim/ai1", "", (AITerminalConfiguration)(RSE), 0, 5, "CustomScale");
09-09-2016 06:34 AM
Hi,
It looks OK but the min and max parameters must be in the scaled units. If your input voltage range is 0-5 V your scaled range is -150-150:
myTask.AIChannels.CreateVoltageChannel("Sim/ai1", "", (AITerminalConfiguration)(RSE), -150, 150, "CustomScale")
BR,
Ilkka
09-09-2016 12:26 PM
That worked! THANKS!!!