I'm trying to access a CM3 data logger via Ethernet using a python wrapper around the libplcm3.so driver. I've installed the driver on Ubuntu 14.04, compiled the C code example, and seem to be able to access the CM3 remotely so I assume that everything is working fine.
There seems to be plenty of examples of python wrappers for the picoscope USB interface & so I've written a very simple test harness based on this code to interface to the logger.
- Code: Select all
from ctypes import *
testlib = ctypes.CDLL('/opt/picoscope/lib/libplcm3.so')
c_handle = c_int16()
serial = None
IPAddress = create_string_buffer("192.168.1.150")
g_status = testlib.PLCM3OpenUnitViaIp(byref(c_handle), serial, IPAddress)
print "PICO status: ", g_status
if __name__ == "__main__":
However when I run this script I get the following error: terminate called after throwing an instance of 'char const*'
Aborted (core dumped)
The problem seems to be with the handle call, any one done this already or any suggestions as to what is happening here?