ps4000aSetSimpleTrigger() returned 13

Post your C and C++ discussions here
Post Reply
hinxx
Newbie
Posts: 0
Joined: Mon May 13, 2019 12:45 pm

ps4000aSetSimpleTrigger() returned 13

Post by hinxx »

I'm writing a C/C++ application that uses PS4000A API with PS4824. The code is written with EPICS (epics.anl.gov) toolkit version R3.15.5.

If I use a single channel (the rest are ignored by the code) I can operate the PS4824 as expected.
As soon as I start to deal with more channels, I get an error returned from ps4000aSetSimpleTrigger() API call, status == 13:

From PicoStatus.h I can tell it is:

Code: Select all

// A parameter value is not valid.
#define PICO_INVALID_PARAMETER                      0x0000000DUL
Here some console output from the code I wrote:

Code: Select all

checkForDevice: device ALREADY opened, handle 1!
checkForDevice: ps4000aPingUnit() returned 0
setupChannel: channel 0, enabled 0, coupling DC, range 8
setupChannel: ps4000SetChannel() returned 0
setupTrigger: using simple triggering, enabled 0!
setupTrigger: ps4000aSetSimpleTrigger() returned 0
setupBuffer: ch 0, raw bufffer size 2000
setupBuffer: ps4000aSetDataBuffer() returned 0, ch 0
setupChannel: channel 1, enabled 0, coupling DC, range 8
setupChannel: ps4000SetChannel() returned 0
setupTrigger: using simple triggering, enabled 0!
setupTrigger: ps4000aSetSimpleTrigger() returned 0
setupChannel: channel 2, enabled 0, coupling DC, range 8
setupChannel: ps4000SetChannel() returned 0
setupTrigger: using simple triggering, enabled 0!
setupTrigger: ps4000aSetSimpleTrigger() returned 0
setupChannel: channel 3, enabled 0, coupling DC, range 8
setupChannel: ps4000SetChannel() returned 0
setupTrigger: using simple triggering, enabled 0!
setupTrigger: ps4000aSetSimpleTrigger() returned 0
setupChannel: channel 4, enabled 0, coupling DC, range 8
setupChannel: ps4000SetChannel() returned 0
setupTrigger: using simple triggering, enabled 0!
setupTrigger: ps4000aSetSimpleTrigger() returned 0
setupChannel: channel 5, enabled 0, coupling DC, range 8
setupChannel: ps4000SetChannel() returned 0
setupTrigger: using simple triggering, enabled 0!
setupTrigger: ps4000aSetSimpleTrigger() returned 0
setupChannel: channel 6, enabled 0, coupling DC, range 8
setupChannel: ps4000SetChannel() returned 0
setupTrigger: using simple triggering, enabled 0!
setupTrigger: ps4000aSetSimpleTrigger() returned 13

For some reason I always get this problem for the sixth channel, out of eight channels that PS4824 supports.

Any ideas? I can share the complete code if it would help..

Thanks!

hinxx
Newbie
Posts: 0
Joined: Mon May 13, 2019 12:45 pm

Re: ps4000aSetSimpleTrigger() returned 13

Post by hinxx »

I think I found the problem. I was not paying close attention to the way my buffers were allocated; turns out I only had one buffer properly allocated and setup with the unit.

I’m curios why it did not fail for channels 2-5, but only for channel 6, though..

Martyn
Site Admin
Site Admin
Posts: 4501
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: ps4000aSetSimpleTrigger() returned 13

Post by Martyn »

We would need to see the full code to be able to comment on that, and as it is now working and you understand the buffering it is probably not worthwhile.
Martyn
Technical Support Manager

hinxx
Newbie
Posts: 0
Joined: Mon May 13, 2019 12:45 pm

Re: ps4000aSetSimpleTrigger() returned 13

Post by hinxx »

You're right Martyn..

Post Reply