Test and Measurement Forum

6404D streaming on Ubuntu 16.04LTS

Post your Linux discussions here

6404D streaming on Ubuntu 16.04LTS

Postby adescour » Wed Jun 22, 2016 11:18 am

Hi,

I have written several python scripts working both on Windows 7 and Ubuntu 16.04LTS for my 6404D.
But I am facing an issue in streaming mode, a script working fine on Windows reports an error on Linux (0x0D, PICO_INVALID_PARAMETER, A parameter value is not valid.) when calling the RunStreaming function of the driver.
Here are the values of the parameters for the call:
Code: Select all
    sampleInterval = 10
    sampleIntervalTimeUnits = self.TIME_UNITS["NS"]
    maxPreTriggerSamples = 0
    maxPostTriggerSamples = 100000
    autoStop = 0
    downSampleRatio = 1
    downSampleRatioMode = self.RATIO_MODE["NONE"]

I am using the latest version of the driver libps6000 is already the newest version (1.4.6-6r13).
Is there any known issues for the linux driver with streaming mode or is there anything wrong with my code?

Regards
Adescour
adescour
Newbie
 
Posts: 0
Joined: Wed Jun 22, 2016 11:01 am

Re: 6404D streaming on Ubuntu 16.04LTS

Postby mario_ » Wed Jun 22, 2016 12:39 pm

Hi Adescour,

The parts of code responsible for evaluating parameters are exactly the same between Windows and Linux. The only thing that comes to my mind is the difference in declared types and how ctypes handles it between windows/linux - especially int32 vs uint32 or on system level long in win is int32 while in linux it is int64. What types do you pass while declaring argtypes?


Mario
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: 6404D streaming on Ubuntu 16.04LTS

Postby adescour » Wed Jun 22, 2016 12:54 pm

The argtypes are passed as following:
Code: Select all
       m = self.lib.ps6000RunStreaming(c_int16(self.handle), byref(sampleInterval),
                                        c_int16(sampleIntervalTimeUnits),
                                        c_uint32(maxPreTriggerSamples),
                                        c_uint32(maxPostTriggerSamples),
                                        c_int16(autoStop),
                                        c_uint32(downSampleRatio),
                                        c_int16(downSampleRatioMode),
                                        c_uint32(buffer))
adescour
Newbie
 
Posts: 0
Joined: Wed Jun 22, 2016 11:01 am

Re: 6404D streaming on Ubuntu 16.04LTS

Postby mario_ » Thu Jun 23, 2016 6:57 am

Thanks for the snippet. I can already see that you have used c_int16 for enums, where it should be c_int32.
In my examples I use the following argtypes:

Code: Select all
[c_int16, c_void_p, c_int32, c_uint32, c_uint32, c_int16, c_uint32, c_int32, c_uint32]

It may have difference, depending on the byte alignment between systems.

Mario
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: 6404D streaming on Ubuntu 16.04LTS

Postby adescour » Thu Jun 23, 2016 9:33 am

I changed the enum to c_int32 and it is now working.
Thank you very much for your help Mario.

Best regards
Adescour
adescour
Newbie
 
Posts: 0
Joined: Wed Jun 22, 2016 11:01 am


Return to Linux

Who is online

Users browsing this forum: No registered users and 0 guests