LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

arithmetic on an analog input channel

Solved!
Go to solution

I am using an NI 9239 card to read four analog input channels. The data samples are interleaved. On my fourth channel, I would like to divide each sample by 2 and subsequnectly plot this data to a strip chart. I have been searching the NI-DAQmx Help to look for ways to scale this channel, but I have not had much luck doing so. I am relatively new to LabWindows and am not positive if there is a built-in function to perform this kind of task, or if I should think about creating my own function to divide every fourth sample by 2. 

 

Thanks.

0 Kudos
Message 1 of 4
(4,470 Views)
Solution
Accepted by topic author atw2

You do not need to change the data array. The chart can do it for you.

 

Look for the "gain" setting in the related Y axis.

(double click on the chart control and change parameters for the Y axis)

 

Hope this helps,

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 4
(4,447 Views)
Solution
Accepted by topic author atw2

As an alternative to ebalci suggestion, you can make DAQmx driver do this work for you.

 

If you are creating the channels in MAX loading them in reading task with DAQmxAddGlobalChansToTask, then you can add the scale directy in MAX:

DAQmx Scale.png

 

 

 

If on the contrary you are creating the channels at runtime you must previously create a custom scale with DAQmxCreateLinScale and pass the scale name in the corresponding parameter of DAQmxCreateAIVoltageChan.

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 4
(4,441 Views)

Robert and ebalci, thank you for your responses. I adjusted the gain on the chart settings and solved my little issue, thank you! Also,manually adjusting the scale worked just as well for me, Roberto, however we have been using the software on multiple computers, so manually adjusting the driver settings on each machine probably won't be practical.

 

Thanks again for the help! 

0 Kudos
Message 4 of 4
(4,415 Views)