01-25-2006 04:48 AM
Ok so this is the problem....
I have set up a signal generator to output a range of Vrms voltages to a dvm and a NiDAq Pad 6015.
I take a reading from both and unsurprisingly they are not the same! So I plotted a nice polynomial to represent the difference and created a scale.
After applying the said scale to the voltage channel and reacquiring the samples they are not brought closer together which is the whole aim but in fact further apart. I have tried applying the polynomial scaling as both forward and backward coefficients, I’ve tried using table scaling (same problem.) so I have come to conclusion that I am doing something that is fundamentally wrong. The question is what?
My approach to acquiring data is here:
Create a task
Create task reader and attach.
inside task
Create a channel
Configure clock
Read in Scale
CNiDAQmxTableScale loadedScale= CNiDAQmxSystem::LoadScale("Programmatic");
Apply Scale
CTime expiration(2007,1,18,23,59,59);
this->GetAIChannels(_T("Voltage0")).SetCalibrationExpirationDate(expiration);
this-> GetAIChannels(_T("Voltage0")).SetCalibrationPolynomialForwardCoefficients(poly.GetForwardCoefficients());
this-> GetAIChannels(_T("Voltage0")).SetCalibrationPolynomialReverseCoefficients(poly.GetReverseCoefficients());
this-> GetAIChannels(_T("Voltage0")).SetCalibrationScaleType(DAQmxAIChannelCalibrationScaleTypePolynomial);
this->GetAIChannels(_T("Voltage0")).SetCalibrationEnable(true);
this->GetAIChannels(_T("Voltage0")).SetCustomScaleName(poly.GetName());
this->GetAIChannels(_T("Voltage0")).SetVoltageUnits(DAQmxAIVoltageUnitsFromCustomScale);
Call an attached reader to read the data :
m_taskReader.ReadMultiSample(-1, data);
Ps I have posted this in Multifunction Daq Board aswell but i realise that it's probably more accuratley placed in here, so appologies for duplicating.