Jump to content
  • 0

Record Mode Python Example Problem


Reinhard

Question

Hello everyone,

I've tried the python analogin_record example, I've connencted the w1 output channel with the first analog in but the data that is recorded looks very wrong (see attached picture).

Other analogin examples work without problem, is there something special with the record mode?

Thank you!!

Figure_1.png.1668e85f5d8941601fee4eec46a88ae4.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

To answer my own question and also as a bug report:

In the python example analogin_record.py is an error at line number 98 which reads the samples from the device into rgdSamples.

The original and wrong line is:

dwf.FDwfAnalogInStatusData(hdwf, c_int(0), byref(rgdSamples, cSamples), cAvailable) # get channel 1 data

The correct line has to be:

dwf.FDwfAnalogInStatusData(hdwf, c_int(0), byref(rgdSamples, cSamples * sizeof(c_double)), cAvailable) # get channel 1 data

Explanation: Byref(var,offset) has to be understood as (((char*)&var)+offset).

I would also suggest to move all python examples to python 3.x.

 

Cheers

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...