Jump to content
  • 0

SDK - function to check if device is still connected


kojak

Question

Hello @attila,

I am writing application in Python and I do not find any function which tells me if already opened device (AD2) is still connected into the system. I need this function in order to inform user about disconnected device and to stop the measurement process and wait for device to be accessible.

Thank you

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hi @kojak

You can use almost any function (*set, *configure, *status) to see if the device is connected since the function will fail if the device is not present. 
If you use the analog-io-status you can update some device information (supply and temperature), see AnalogIO_AnalogDiscovery2_SystemMonitor.py

if dwf.FDwfAnalogIOStatus(hdwf) == 0 :
  szerr = create_string_buffer(512)
  dwf.FDwfGetLastErrorMsg(szerr)
  print szerr.value
  break;
# get system monitor readings
dwf.FDwfAnalogIOChannelNodeStatus(hdwf, c_int(2), c_int(0), byref(usbVoltage))
dwf.FDwfAnalogIOChannelNodeStatus(hdwf, c_int(2), c_int(1), byref(usbCurrent))
dwf.FDwfAnalogIOChannelNodeStatus(hdwf, c_int(2), c_int(2), byref(deviceTemperature))
dwf.FDwfAnalogIOChannelNodeStatus(hdwf, c_int(3), c_int(0), byref(auxVoltage))
dwf.FDwfAnalogIOChannelNodeStatus(hdwf, c_int(3), c_int(1), byref(auxCurrent))

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...