Jump to content

agentsmith

Members
  • Posts

    1
  • Joined

  • Last visited

agentsmith's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. I working on an application that allows continuous streaming of data. Due to certain reasons, I cannot use the ShiftScreen functionality: My producer process (the AD2 device) captures the available samples from the device and then they are sent to the consumer process. For this, I used the sample AnalogIn_Record_Wave_Mono.py as a basis. Note: This behavior has only been seen on demo devices yet. Since I'm in Homeoffice right now, I do not have physical access to our Analog Discovery to verify if it is an issue with the API or the Demo Implementation. However, even if it is an issue with the demo device this is crucial, for debugging reasons, I also need to not require physical hardware. The first thing I noticed is that the API call differs from the WafeForm API Documentation. The Code suggests, that a -1 passed to the function # AnalogIn_Record_Wave_Mono.py, Line 79: dwf.FDwfAnalogInRecordLengthSet(hdwf, c_double(-1)) # -1 infinite record length however, the documentation clearly says that a zero must be passed to set the record length to infinite: Secondly, the passed -1 seems to work with physical hardware (like the AD2). The same parameter seems to be accepted also by the Demo devices, however, using this line with the Demo device and reading the available samples raises a ValueError: # AnalogIn_Record_Wave_Mono.py, Line 140 rgSamples = (c_int16*cAvailable.value)() # ---------------------------------------------------# Traceback (most recent call last): File "C:\...\py\AnalogIn_Record_Wave_Mono.py", line 140, in <module> rgSamples = (c_int16*cAvailable.value)() ValueError: Array length must be >= 0, not -2146675454 Passing a zero, the data captures are corrupted but are not recognized by the drive as currupted. dwf.FDwfAnalogInRecordLengthSet(hdwf, c_double(10)) # 10 seconds dwf.FDwfAnalogInRecordLengthSet(hdwf, c_double(0)) # 10 seconds I have attached my example file as well. How do I cope with this issue (Point 2/Point3)? Kind regards, Chris AnalogIn_Record_Wave_Mono.py
×
×
  • Create New...