Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx analog read with offest

Solved!
Go to solution

In the test I am trying to setup, I need to record load readings with the initial load taken out.  I take the initial reading and then subtract that from all following readings. Say I have an initial load of 50lbs, I want all readings taken during the test to offset by 50lbs.

 

Currently I take a reading before entering the acquisition loop and subtract the inital reading from all new readings before recording the data. What I would like to do, is somehow tell DAQmx to do the offset for me. Is that possible? and if so how whould I do that?

 

Thanks

Ryan Podsim, CLA
0 Kudos
Message 1 of 2
(2,712 Views)
Solution
Accepted by topic author rpodsim

Hi Ryan,

You can use the following function:

int32 DAQmxCreateLinScale (const char name[], float64 slope, float64 yIntercept, int32 preScaledUnits, const char scaledUnits[])

If you create a scale in the above way, you must modify your CreateAI...Chan function. Replace "units" parameter to "DAQmx_Val_FromCustomScale" and set "customScaleName" to name that you specify in the DAQmxCreateLinScale function.

You can find detailed info in the ni-daqmx c reference help!


Greets,

- George -

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