Test and Measurement Forum

Data logger Pt104, Ethernet problem

Post your Linux discussions here

Data logger Pt104, Ethernet problem

Postby lena » Thu Mar 31, 2016 12:30 pm

Hello,

I was successfully using RPi (Raspbian GNU/Linux 7 operating system) and a simple python script to obtain the temperature values. However when I wanted to switch from USB to Ethernet connection a problem occured.
Here is a part of the code that I was using for a USB connection:
Code: Select all
mydll=cdll.LoadLibrary('/opt/picoscope/lib/libusbpt104.so.2')
handlePointer=c_short()
temp=np.zeros((9,),dtype=np.int64)
status_unit=mydll.UsbPt104OpenUnit(byref(handlePointer),'Serial number')
print 'open unit status:', status_unit
mydll.UsbPt104SetChannel(handlePointer,1,1,2)
status_channel=mydll.UsbPt104SetChannel(handlePointer,1,1,2)
print 'open channel status', status_channel

For the Etharnet connection I just replaced the old status_unit with:
Code: Select all
status_unit=mydll.UsbPt104OpenUnitViaIp(byref(handlePointer),'Serial number','IP address')

I run the script as a root and for the values of status_unit and status_channel got the values of 3 and 12, respectively (instead of 0 and 0). I have to note that ethernet is enabled and running without any problems with a Picolog recorder.

Thanks in advance!
lena
Newbie
 
Posts: 0
Joined: Mon Sep 21, 2015 12:15 pm

Re: Data logger Pt104, Ethernet problem

Postby Hitesh » Fri Apr 01, 2016 8:44 am

Hi lena,

When connecting via USB what value do you get for handlePointer?

Are you passing the strings 'Serial number' and 'IP Address' as an argument? If so, that would be incorrect - you should be passing the string representing the serial number e.g. 'ABC12/345', the IP address with port number (e.g. '172.16.0.2:6500') or pass a null parameter.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to Linux

Who is online

Users browsing this forum: No registered users and 0 guests