05-25-2013 03:06 PM - edited 05-25-2013 03:08 PM
Hello,
On a similar note to the posts at https://forums.ni.com/t5/High-Speed-Digitizers/How-are-offset-and-gain-in-the-niScope-fetch-function... and http://forums.ni.com/t5/High-Speed-Digitizers/Where-to-find-gain-and-offset-of-USB-5132-running-in-C... , I am trying to extract the gain and offset of our USB 5132 digitizer from the output data file. The file contains the "Fetch" event argument e.Result, and is sent to file in C# like this:
binaryFormatter.Serialize(fileStream, e.Result); .
I would like to read in the data file and determine what the gain and offset of the digitizer is. I don't think I can use "Fetch" to read the file (is that correct)? Currently I am reading the waveform data like this:
AnalogWaveform<int>[] records = binaryFormatter.Deserialize(fileStream) as AnalogWaveform<int>[]; .
I am thinking that there should be a way to get the gain and the offset because this routine can apparently do it:
private AnalogWaveform<double>[] ScaleRecords(AnalogWaveform<int>[] records); .
Also, I tried to get the ScopeWaveformInfo like this:
ScopeWaveformInfo[] info = binaryFormatter.Deserialize(fileStream) as ScopeWaveformInfo[];
but got a null result in the structure. Could this have been the right approach though?
Is there some way to get the gain and offset of the digitizer without using Fetch? If not, is there some way to use Fetch when reading data from a file, and then extracting the gain and offset the usual way (from Fetch)?
Thanks for any thoughts on this.
Regards,
Penny
Solved! Go to Solution.
06-07-2013 09:19 AM
I found a workaround for this - get the gain and offset with fetch using a different data set. The calibration seems stable enough to do this.
Thanks,
Penny