Jump to content
  • 1

AnalogInRecord with two channels


whbweb

Question

I've worn Google out trying to find the answer to what I bet is a simple question. Part of my problem may be weak Python skills and almost nonexistent C skills. I'm using the Python examples in the SDK to turn on the 5 V power supply and then record data from both channels. I used AnalogIn_Record.py and made what I thought were reasonable changes, but no joy. I can record one channel or the other, but not both. I feel like this is not a hard problem and it must have come up before, but I can't find it so far. Any help would be appreciated.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hi @whbweb

The second argument of the FDwfAnalogInStatusData function specifies the channel index.
The data is fetched to the host with the earlier FDwfAnalogInStatus(hdwf, true/1,..., so the returned data will be synchronous.

BOOL FDwfAnalogInStatusData(HDWF hdwf, int idxChannel, double *rgdVoltData, int cdData);

   ...
   dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))
   ...
   # get samples
   dwf.FDwfAnalogInStatusData(hdwf, c_int(0), byref(rgdSamples1, cSamples), cAvailable) # 0 = channel 1 data
   dwf.FDwfAnalogInStatusData(hdwf, c_int(1), byref(rgdSamples2, cSamples), cAvailable) # 1 = channel 2 data
   ...

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...