Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to get DAQmx to use scale property values that have changed since the task/channels have been created?

In CVI 8.0, I create a task and channels and start acquiring data.  If I use the DAQmxSetScaleAttribute function to change the slope of the linear scale associated with a channel there is no change in the acquired data.  The task is a single multipoint acquisition, it is stopped and started the next time data is required.  The only way I've found to get the new slope value applied is to clear the task and generate it again.  Is there another way that doesn't require the task to be regenerated?  TIA
0 Kudos
Message 1 of 3
(2,619 Views)
Hello DAD,

There is no way I can think of to programmatically alter the slope of a custom scale without reconfiguring your channel using the  DAQmxCreateAIVoltageChan function.  The custom scale information is saved in Measurement & Automation Explorer (MAX) separate from your task, and the scale is applied to your DAQmx task during configuration.  The main purpose of the DAQmxSetScaleAttribute function is to programmatically alter a custom scale for resaving in MAX or applying ot your task prior to configuration.  As a workaround, I would recommend coding a simple algorithm that scales your values in software using basic math functions after they are acquired.  This will allow you to change the multiplication factor of your data on the fly.  For a linear scale, it should be just a matter of multiplying your raw values by a slope and adding a y-intercept.

Regards,
Travis Gorkin
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 2 of 3
(2,600 Views)

Travis,

Thanks for the feedback.  Since I had suspected this was the case, I had already modified my code to clear the tasks and re-generate them if a scale is modifed.  The time to do this is negligable as far as my application is concerned.

DAD

0 Kudos
Message 3 of 3
(2,594 Views)