05-27-2015 11:14 AM
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.
Solved! Go to Solution.
05-28-2015 12:29 AM
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,
05-28-2015 01:54 AM
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:
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.
05-28-2015 12:01 PM
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!