Test and Measurement Forum

6k series: trigger on aux

Post your Linux discussions here

6k series: trigger on aux

Postby darko.veberic » Thu Jul 06, 2017 5:06 pm

Hi,

in our DAQ project, which runs on linux 16.04 LTS, we were up to now using a 6403B PicoScope (on USB2).
Since we wanted to read-out all four channels, we decided to bring the external trigger to the PicoScope via the AUX channel. The external trigger is a simple NIM signal, ie on DC50 it has 0V for logical false and -0.8V for logical true so that AUX input seems perfect for this job. The trigger pulse is ~300ns long and the typical traces that we take are 4000 samples long at 0.8ns sampling time. In my code I used the SimpleTrigger functions to set up all this and the daq was working flawlessly.

Nevertheless, after an upgrade to a PicoScope 6404D (for bandwidth reasons) I've encountered really strange behavior. In the DAQ setup the new PicoScope did not trigger at all, reaching my call limit in polling of the IsReady. When I tried it on my desktop with a function generator closely mimicking the NIM signal, at first the PicoScope refused to trigger. After I left it running with an open GUI over the night, in the morning of the next day suddenly I could get it running. Unfortunately, installing it back into the DAQ setup, it still does not trigger. Just for test, I replaced it again with the old 6403B PicoScope and the exactly same code works flawlessly.

What could be the reason for such behavior? Are the new PicoScopes requiring some more setup steps which I am currently failing to do (and the old PicoScope just works fine because of the defaults?).

Thanks in advance for any help with this excellent devices.

Best regards,
Darko.
darko.veberic
Newbie
 
Posts: 0
Joined: Wed Apr 27, 2016 9:14 am

Re: 6k series: trigger on aux

Postby Hitesh » Fri Jul 07, 2017 9:37 am

Hi Darko,

Does the issue also occur with the PicoScope 6 for Linux software?

The AUXIN connector has an 50 Ohm impedance so please check that the input matches that.

We are aware of an issue related to triggering using the auxiliary input with the windows driver which was fixed some time ago so it could be related. We are due to release a new version of the software for Linux so an updated libps6000 driver package should also be available.

Which programming language are you using?

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2682
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: 6k series: trigger on aux

Postby darko.veberic » Fri Jul 07, 2017 10:30 am

Hi,

> Does the issue also occur with the PicoScope 6 for Linux software?

Do you mean with the GUI scope? I would say yes, but fiddling with the trigger settings somehow (I cannot reproduce it) makes it work.

> The AUXIN connector has an 50 Ohm impedance so please check that the input matches that.

Yes, NIM standard is current-based with logical true -16 mA (which into 50ohm gives −0.8V). So this should work correctly when the trigger level is set to -0.4V. And in fact, with the 6403A/B, it does work flawlessly. But not with 6404D.

> We are aware of an issue related to triggering using the auxiliary input with the windows driver which was fixed
> some time ago so it could be related. We are due to release a new version of the software for Linux so an
> updated libps6000 driver package should also be available.

I am getting the libraries via your debian apt repository. The current version of the picoscope deb package is 6.11.13-4r3 with libps6000.so.2.0.0. The ps6000GetUnitInfo(PICO_DRIVER_VERSION) returns "PS6000 Linux Driver, 1.4.6.13".

> Which programming language are you using?

The whole DAQ is written in C++ and we are calling your C api.

Best,
Darko.
darko.veberic
Newbie
 
Posts: 0
Joined: Wed Apr 27, 2016 9:14 am

Re: 6k series: trigger on aux

Postby darko.veberic » Sun Jul 09, 2017 10:54 am

Dear Hitesh,

Hitesh wrote:We are aware of an issue related to triggering using the auxiliary input with the windows driver which was fixed some time ago so it could be related. We are due to release a new version of the software for Linux so an updated libps6000 driver package should also be available.


For us this is a total showstopper. Do you have any timeframe for the release of the new version? We can test it immediately.

Best regards,
Darko.
darko.veberic
Newbie
 
Posts: 0
Joined: Wed Apr 27, 2016 9:14 am

Re: 6k series: trigger on aux

Postby Hitesh » Mon Jul 10, 2017 9:19 am

Hi Darko,

Could you please e-mail support@picotech.com and I will look to assist you further.

Thanks,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2682
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: 6k series: trigger on aux

Postby darko.veberic » Thu Jan 18, 2018 6:03 pm

Sorry for late reply but we were busy with measurements and the way how we were using the PicoScope was working OK. Nevertheless, we wanted to perform a similar measurement, but now not externally triggered but triggered with the SimpleTrigger on the trace itself.

What is special about this measurement is that the PicoScope should take triggered captures during some well defined time (either by a timer or external events, known to the code). The code sets up 3 channels (A, B, C) and the trigger is set to simple positive-slope threshold on channel B where a TTL-like signal is observed.

Below is the sequence of calls that is made to the PicoScope API:

ps6000OpenUnit(handle=0x7fff7432051e, serial=0) -> 0; *handle=1, *serial=nullptr
ps6000OpenUnit(handle=0x7fff7432051e, serial=0) -> 3; *handle=-1, *serial=nullptr
ps6000SetChannel(handle=1, channel=0, enabled=1, type=2, range=6, analogueOffset=0, bandwidth=0) -> 0
ps6000SetChannel(handle=1, channel=1, enabled=1, type=1, range=7, analogueOffset=0, bandwidth=0) -> 0
ps6000SetChannel(handle=1, channel=2, enabled=1, type=2, range=6, analogueOffset=0, bandwidth=0) -> 0
ps6000GetTimebase2(handle=1, timebase=0, noSamples=100, timeIntervalNanoseconds=0x7fff743200fc, oversample=1, maxSamples=0x1634948, segmentIndex=0) -> 14; *timeIntervalNanoseconds=0, *maxSamples=0
ps6000GetTimebase2(handle=1, timebase=1, noSamples=100, timeIntervalNanoseconds=0x7fff743200fc, oversample=1, maxSamples=0x1634948, segmentIndex=0) -> 14; *timeIntervalNanoseconds=0, *maxSamples=0
ps6000GetTimebase2(handle=1, timebase=2, noSamples=100, timeIntervalNanoseconds=0x7fff743200fc, oversample=1, maxSamples=0x1634948, segmentIndex=0) -> 0; *timeIntervalNanoseconds=0.800000012, *maxSamples=268435328
ps6000SetEts(handle=1, mode=0, etsCycles=0, etsInterleave=0, sampleTimePicoseconds=0) -> 0; *sampleTimePicoseconds=nullptr
ps6000SetSimpleTrigger(handle=1, enable=1, source=1, threshold=2560, direction=2, delay=0, autoTrigger_ms=0) -> 0
ps6000SetDataBuffer(handle=1, channel=0, buffer=0x16215d0, bufferLth=100, downSampleRatioMode=0) -> 0
ps6000SetDataBuffer(handle=1, channel=1, buffer=0x1621bc0, bufferLth=100, downSampleRatioMode=0) -> 0
ps6000SetDataBuffer(handle=1, channel=2, buffer=0x1621c90, bufferLth=100, downSampleRatioMode=0) -> 0
ps6000MemorySegments(handle=1, nSegments=1000, nMaxSamples=0x1634948) -> 0; *nMaxSamples=1064448
ps6000RunBlock(handle=1, noOfPreTriggerSamples=50, noOfPostTriggerSamples=50, timebase=2, oversample=1, timeIndisposedMs=0x7fff743205cc, segmentIndex=0, lpReady=0, pParameter=0) -> 0; *timeIndisposedMs=0
ps6000Stop(handle=1) -> 0
ps6000IsReady(handle=1, ready=0x7fff743203da) -> 0; *ready=1
ps6000GetNoOfCaptures(handle=1, nCaptures=0x7fff743202ec) -> 0; *nCaptures=1
ps6000SetDataBufferBulk(handle=1, channel=0, buffer=0x1907f00, bufferLth=100, waveform=0, downSampleRatioMode=0) -> 0
ps6000SetDataBufferBulk(handle=1, channel=1, buffer=0x1908010, bufferLth=100, waveform=0, downSampleRatioMode=0) -> 0
ps6000SetDataBufferBulk(handle=1, channel=2, buffer=0x1908120, bufferLth=100, waveform=0, downSampleRatioMode=0) -> 0
ps6000GetValuesBulk(handle=1, noOfSamples=0x7fff74320400, fromSegmentIndex=0, toSegmentIndex=0, downSampleRatio=1, downSampleRatioMode=0, overflow=0x19087f0) -> 0; *noOfSamples=100
event 0, t=20.0941
ps6000CloseUnit(handle=1) -> 0

In all cases we only get one capture although for sure there was a periodic signal that should trigger the PicoScope with 10Hz. Setting up the PicoScope in exactly the same way via the "picoscope" GUI, we see nice traces coming in.

What are we doing wrong? Note that this use case is not described in the Programming Manual at all, ie the case where we have a trigger on some channel and we want to capture internally, into segmented memory, traces that trigger within some prescribed time, ie we do not know exactly how many captures will occur.
darko.veberic
Newbie
 
Posts: 0
Joined: Wed Apr 27, 2016 9:14 am

Re: 6k series: trigger on aux

Postby Hitesh » Fri Jan 19, 2018 10:11 am

Hi Darko,

If you wish to capture multiple waveforms on a trigger event without having to call the ps6000RunBlock() function, please call ps6000SetNoOfCaptures() after the call to ps6000MemorySegments() as this will instruct the device to capture data every time a trigger event occurs until the Users stops the capture or the number of waveforms specified have been captured.

Hope this helps,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2682
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: 6k series: trigger on aux

Postby darko.veberic » Fri Jan 19, 2018 11:35 am

Dear Hitesh,

no, this doesn't work either. See debug output below. The IsReady returns PICO_NO_SAMPLES_AVAILABLE, also GetNoOfCaptures returns 0.

We are really totally desperate to get this working to no avail.

I am not sure why you say I should not run RunBlock? Is RunBlock a misnomer? It namely does not block but comes back to the code. It is not clear what exactly "Block" means...? Block like in building block or block like in blocking...?

ps6000OpenUnit(handle=0x7fff300716ee, serial=0) -> 0; *handle=1, *serial=nullptr
ps6000OpenUnit(handle=0x7fff300716ee, serial=0) -> 3; *handle=-1, *serial=nullptr
ps6000SetChannel(handle=1, channel=0, enabled=1, type=2, range=6, analogueOffset=0, bandwidth=0) -> 0
ps6000SetChannel(handle=1, channel=1, enabled=1, type=1, range=7, analogueOffset=0, bandwidth=0) -> 0
ps6000SetChannel(handle=1, channel=2, enabled=1, type=2, range=6, analogueOffset=0, bandwidth=0) -> 0
ps6000GetTimebase2(handle=1, timebase=0, noSamples=100, timeIntervalNanoseconds=0x7fff3007128c, oversample=1, maxSamples=0x1321d50, segmentIndex=0) -> 14; *timeIntervalNanoseconds=0, *maxSamples=0
ps6000GetTimebase2(handle=1, timebase=1, noSamples=100, timeIntervalNanoseconds=0x7fff3007128c, oversample=1, maxSamples=0x1321d50, segmentIndex=0) -> 14; *timeIntervalNanoseconds=0, *maxSamples=0
ps6000GetTimebase2(handle=1, timebase=2, noSamples=100, timeIntervalNanoseconds=0x7fff3007128c, oversample=1, maxSamples=0x1321d50, segmentIndex=0) -> 0; *timeIntervalNanoseconds=0.800000012, *maxSamples=268435328
ps6000SetEts(handle=1, mode=0, etsCycles=0, etsInterleave=0, sampleTimePicoseconds=0) -> 0; *sampleTimePicoseconds=nullptr
ps6000SetSimpleTrigger(handle=1, enable=1, source=1, threshold=2560, direction=2, delay=0, autoTrigger_ms=0) -> 0
ps6000SetDataBuffer(handle=1, channel=0, buffer=0x130e5d0, bufferLth=100, downSampleRatioMode=0) -> 0
ps6000SetDataBuffer(handle=1, channel=1, buffer=0x130ebc0, bufferLth=100, downSampleRatioMode=0) -> 0
ps6000SetDataBuffer(handle=1, channel=2, buffer=0x130ec90, bufferLth=100, downSampleRatioMode=0) -> 0
ps6000MemorySegments(handle=1, nSegments=1000, nMaxSamples=0x1321d50) -> 0; *nMaxSamples=1064448
ps6000SetNoOfCaptures(handle=1, nCaptures=1000) -> 0
ps6000Stop(handle=1) -> 0
ps6000IsReady(handle=1, ready=0x7fff300715aa) -> 37; *ready=0
ps6000GetNoOfCaptures(handle=1, nCaptures=0x7fff300714bc) -> 37; *nCaptures=0
ps6000CloseUnit(handle=1) -> 0
GetActualNCaptures: # captures failed with status 0x00000025 for device 1

Best regards,
Darko.
darko.veberic
Newbie
 
Posts: 0
Joined: Wed Apr 27, 2016 9:14 am

Re: 6k series: trigger on aux

Postby darko.veberic » Fri Jan 19, 2018 1:10 pm

Dear Hitesh,

we were able to track down the exact reason why suddenly the usual way of capturing self-triggered traces to memory does not work anymore: the reason is I updated the picoscope libraries on the DAQ Ubuntu machine. It seems you have a regression in your libps6000 libraries, and if you ask me, it's a very serious one! This is very sad since I am not sure I can restore the older version of the picoscope libraries. Are they still available as .deb files?

Best regards,
Darko.
darko.veberic
Newbie
 
Posts: 0
Joined: Wed Apr 27, 2016 9:14 am

Re: 6k series: trigger on aux

Postby Hitesh » Fri Jan 19, 2018 5:18 pm

Hi Darko,

You still need to call ps600RunBlock() in this section of code to start the data collection and poll the ps6000IsReady() function until the device indicates it is ready (unless you call ps6000Stop() before the device indicates that it is ready):

Code: Select all
ps6000MemorySegments(handle=1, nSegments=1000, nMaxSamples=0x1321d50) -> 0; *nMaxSamples=1064448
ps6000SetNoOfCaptures(handle=1, nCaptures=1000) -> 0
ps6000Stop(handle=1) -> 0
ps6000IsReady(handle=1, ready=0x7fff300715aa) -> 37; *ready=0
ps6000GetNoOfCaptures(handle=1, nCaptures=0x7fff300714bc) -> 37; *nCaptures=0

Calling ps6000Stop() before ps6000IsReady() would not be recommended.

If this does not work, please e-mail support@picotech.com and we will see what we can do about providing older driver packages.

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2682
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