Multiple triggers on the Picoscope 4824

Post your C and C++ discussions here
Post Reply
johnpm
Newbie
Posts: 0
Joined: Mon Jan 11, 2016 8:48 pm

Multiple triggers on the Picoscope 4824

Post by johnpm »

Hello,
I am writing an application in C for the 4824 where I would like to have two or more window triggers on different inputs - for example on channel 1 and channel 4.

I have created arrays for the trigger parameters and put the channel 1 parameters in the first elements of the arrays and the channel 4 parameters in the second elements.

I can enable either trigger separately by calling the SetTrigger function withe the pointers set to the first or second elements of the arrays and setting the numbers of elements to one.

If I set the pointers to the first elements of the arrays and call Set Trigger with the number of elements set to two it seems (although I can be sure) that both triggers are enabled but they are ANDed together so both trigger conditions must be valid to get a valid trigger.

If I make two separate SetTrigger calls (one for each trigger condition) it seems that the second trigger condition overwrites the first so I only have one trigger set.

How to I set up two independent triggers on separate channels?

I am also a little confused by the description of the ps4000aSetTriggerChannelConditions function. I am not sure when conditions are ORed or when they are ANDed.

Do you have some code examples that would help me or some additional clarification.

Thanks

John

Hitesh

Re: Multiple triggers on the Picoscope 4824

Post by Hitesh »

Hi John,

When you call the ps4000aSetTriggerChannelConditions() function to trigger when the conditions on both Channel A AND Channel D are met, the conditions parameter should consist of an array of two elements. I would also recommend setting the info parameter to info = (PS4000A_CONDITIONS_INFO) (PS4000A_CLEAR | PS4000A_ADD).

If you wish to trigger on Channel A OR Channel D, you will need to call the ps4000aSetTriggerChannelConditions() function twice:

1. On the first occasion, pass the condition structure for Channel A and set info to (PS4000A_CONDITIONS_INFO)(PS4000A_CLEAR | PS4000A_ADD).

2. On the second occasion, pass the condition structure for Channel D but set info to PS4000A_ADD.

If you are still experiencing issues with this, would it be possible to provide code snippets to show how you are setting up the relevant trigger structures and calling the ps4000aSetTriggerChannelConditions() and ps4000aSetTriggerChannelProperties() functions please?

If you are using the SetTrigger() function from the C console example, please note that the code in this function clears any previous trigger conditions and then sets the one being passed through. This is just a function in this example that calls the advanced trigger functions in turn.

Regards,

Post Reply