PS2405A trigger issue on Channel B

Post your VB and VBA discussions here
Post Reply
Posts: 0
Joined: Wed May 20, 2015 11:16 am

PS2405A trigger issue on Channel B

Post by Robimoo »


I have been setting up a 4 channel PS2405A unit and setting it to trigger on Channel B on a rising edge. The channel range is set at ±5v and I want it to trigger on a rising edge at a level of 3V (set by my variable TriggerVolts). I can not seem to get it to trigger properly. The trigger is random and even riggers if I set the threshold above the signal maximum voltage. The signal I am trying to trigger on is a nice clean square wave of 0v to 4.5v, 3Hz. The trigger code I have used is as follows.

Any suggestions ? Thank you.

'Set up the trigger structures

Dim triggerConditions As TRIGGER_CONDITION

triggerConditions.channelA = PS2000A_CONDITION_FALSE
triggerConditions.channelB = PS2000A_CONDITION_TRUE
triggerConditions.channelC = PS2000A_CONDITION_FALSE
triggerConditions.channelD = PS2000A_CONDITION_FALSE
triggerConditions.external = PS2000A_CONDITION_FALSE
triggerConditions.aux = PS2000A_CONDITION_FALSE
triggerConditions.pulseWidthQualifier = PS2000A_CONDITION_FALSE = PS2000A_CONDITION_FALSE
TriggerVolts = Val(Cells(34, "j"))
TriggerBytes = (TriggerVolts / 5) * 32768

triggerChannelPropertiesArray(0) = TriggerBytes 'thresholdUpper
triggerChannelPropertiesArray(1) = 1000 'thresholdUpperHysteresis;
triggerChannelPropertiesArray(2) = 0 'thresholdLower
triggerChannelPropertiesArray(3) = 0 'thresholdLowerHysteresis;
triggerChannelPropertiesArray(4) = 1 'channel
triggerChannelPropertiesArray(5) = 0 'thresholdMode

'Set trigger
Call ps2000aSetTriggerChannelConditions(handle, triggerConditions, 2)
Call ps2000aSetTriggerChannelDirections(handle, 0, PS2000A_RISING, 0, 0, 0, 0) ' Ch A - PS2000A_RISING, Ch B - PS2000A_NONE (PS2000A_RISING = PS2000A_NONE)
Call SetTriggerProperties(handle, triggerChannelPropertiesArray(0), 5, 10000) 'autotriggermilliseconds = 5000

Call RunBlock(handle, preTriggerSamples, postTriggerSamples, timebase, 0)

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

Re: PS2405A trigger issue on Channel B

Post by Martyn »

Can you send a working example showing the issue to and the team can take a look.
Technical Support Manager

Post Reply