|
65 | 65 |
|
66 | 66 | # Set up an advanced trigger |
67 | 67 | adcTriggerLevel = mV2adc(500, chARange, maxADC) |
68 | | -triggerProperties = PS5000A_TRIGGER_CHANNEL_PROPERTIES_V2(adcTriggerLevel, |
| 68 | + |
| 69 | +triggerProperties = ps.PS5000A_TRIGGER_CHANNEL_PROPERTIES_V2(adcTriggerLevel, |
69 | 70 | 10, |
70 | 71 | 0, |
71 | 72 | 10, |
72 | 73 | ps.PS5000A_CHANNEL["PS5000A_CHANNEL_A"]) |
73 | 74 |
|
74 | | -status["setTriggerChannelPropertiesV2"] = ps.ps5000aSetTriggerChannelPropertiesV2(chandle, triggerProperties, length(triggerProperties), 0) |
| 75 | +status["setTriggerChannelPropertiesV2"] = ps.ps5000aSetTriggerChannelPropertiesV2(chandle, ctypes.byref(triggerProperties), 1, 0) |
75 | 76 |
|
76 | | -triggerConditions = PS5000A_CONDITION(ps.PS5000A_CHANNEL["PS5000A_CHANNEL_A"], |
| 77 | +triggerConditions = ps.PS5000A_CONDITION(ps.PS5000A_CHANNEL["PS5000A_CHANNEL_A"], |
77 | 78 | ps.PS5000A_TRIGGER_STATE["PS5000A_CONDITION_TRUE"]) |
78 | 79 |
|
79 | 80 | clear = 1 |
80 | 81 | add = 2 |
81 | 82 |
|
82 | | -status["setTriggerChannelConditionsV2"] = ps.ps5000aSetTriggerChannelConditionsV2(chandle, triggerConditions, length(triggerConditions), (clear + add)) |
| 83 | +status["setTriggerChannelConditionsV2"] = ps.ps5000aSetTriggerChannelConditionsV2(chandle, ctypes.byref(triggerConditions), 1, (clear + add)) |
83 | 84 |
|
84 | | -triggerDirections = PS5000A_DIRECTION(ps.PS5000A_CHANNEL["PS5000A_CHANNEL_A"], ps.PS5000A_THRESHOLD_DIRECTION["PS5000A_RISING"], ps.PS5000A_THRESHOLD_MODE["PS5000A_LEVEL"]) |
| 85 | +triggerDirections = ps.PS5000A_DIRECTION(ps.PS5000A_CHANNEL["PS5000A_CHANNEL_A"], |
| 86 | + ps.PS5000A_THRESHOLD_DIRECTION["PS5000A_RISING"], |
| 87 | + ps.PS5000A_THRESHOLD_MODE["PS5000A_LEVEL"]) |
85 | 88 |
|
86 | | -status["setTriggerChannelDirections"] = ps5000aSetTriggerChannelDirectionsV2(chandle, triggerDirections, length(triggerDirections)) |
| 89 | +status["setTriggerChannelDirections"] = ps5000aSetTriggerChannelDirectionsV2(chandle, ctypes.byref(triggerDirections), 1) |
87 | 90 |
|
88 | 91 |
|
89 | 92 | # Set number of pre and post trigger samples to be collected |
|
0 commit comments