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.
I had an hour free this morning, so I had another play around with the code. It appears that I am able to connect to the CM3 via the USB connector using the following class method code.
def _openUnit(self, serial):
c_handle = c_int16()
if serial is not None:
serialNullTermStr = create_string_buffer(serial)
else:
serialNullTermStr = None
# Passing None is the same as passing NULL
pico_status = self.lib.PLCM3OpenUnit(byref(c_handle), serialNullTermStr)
Or at least I received a return of zero from the library (PICO_OK), and an error code if I screwed around with the serial parameter. Don't know if this throws any light on my previous enquiry.
This seemed a positive step forward so for the time being I'll work on the USB interface and see if that goes anywhere. Ideally what I'd like to be able to do is have full access to the CM3 through a pure python interface so that I can analyse the data output through numpy.
BTW - I'm basing this code on the Github pico-python project code (thanks), do any of the picoscopes have an ethernet interface?
There are a couple of things that you can try with connecting to the device via the Ethernet connection:
If the device is on a local network, try connecting using the Serial number parameter instead of the IP address.
Try appending the port number to the IP address e.g. if the configured port is 4000, pass the string "192.168.1.150:4000"
Does the device IP address and port appear if you query the PLCM3Enumerate() function with the communication type parameter corresponding to 0x00000002?
I'm currently testing on my local network & I get the same results whether I input an IP address + port or the device serial number. I just tested again with the provided C code example and I'm getting the same error with a network connection. My mistake I thought I had tested this earlier & it had worked. I installed the linux driver via your PPA.
Thanks,
Vince
PS With the USB interface ATM everything seems to behave as expected.
PPS I realised after posting this that I'd used the wrong forum, hope that's not an inconvenience.
I have been able to reproduce the issue using our C console application on a Linux PC and have reported this to our Development Team as it seems to affect the PLCM3Enumerate() function as well when attempting to search for Ethernet connected devices.
I hope to provide an update as soon as possible - please continue to develop your application using the USB connection until then.
Ps. I have moved the topic into the correct forum area
Thanks for the feedback, really appreciate your prompt response with following this up!
I had a little look at the software again this afternoon in USB mode. Acquisition doesn't seem to be working either. Up until now I hadn't tested with current probes, today I tested with a known reference current. The error I'm getting is:
0x25 "PICO_NO_SAMPLES_AVAILABLE", "because a run has not been completed."
I made a few changes to the example C code and got the same problem there. As a reference I tested the data logger connected to a windows PC and I did appear to be getting an acquisition with the GUI application.