I have a python script to output a signal while recording from both input channels at the same time.
I want to incorporate using a second analog discovery for two additional channels of data acquisition.
From the device_enumerate.py, I see that both devices can be recognized in the same script, but how do I actually specify which device to record the data from?
For example, here are some current (relevant) code snippets where I acquire data from both channels of one device. How would I specify the second device channels.
..."Opening first device..."
dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf))if hdwf.value == hdwfNone.value:print"failed to open device"
quit()...#set up acquisition
dwf.FDwfAnalogInFrequencySet(hdwf, c_double(20000000.0))
dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(4096))
dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(0), c_bool(True))
dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(0), c_double(10))
dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(1), c_bool(True))
dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(1), c_double(10))...
dwf.FDwfAnalogOutConfigure(hdwf, channel1, c_bool(True))# starts the waveformwhileTrue:
dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))if sts.value ==DwfStateDone.value :break
time.sleep(0.001)
time.sleep(0.1)while(j < pulses +1):try:print j
dwf.FDwfAnalogOutConfigure(hdwf, channel1, c_bool(True))# starts the waveform#begin acquisitionwhileTrue:
dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))if sts.value ==DwfStateDone.value :break
time.sleep(0.001)
time.sleep(0.1)print"Acquisition finished"
dwf.FDwfAnalogInStatusData(hdwf,0, rgdSamples1,4096)# get channel 1 data
dwf.FDwfAnalogInStatusData(hdwf,1, rgdSamples2,4096)# get channel 2 data
Any help or example code would be greatly appreciated!
Question
hgriffin
Hello,
I have a python script to output a signal while recording from both input channels at the same time.
I want to incorporate using a second analog discovery for two additional channels of data acquisition.
From the device_enumerate.py, I see that both devices can be recognized in the same script, but how do I actually specify which device to record the data from?
For example, here are some current (relevant) code snippets where I acquire data from both channels of one device. How would I specify the second device channels.
Any help or example code would be greatly appreciated!
Cheers!
Harry
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.