Skip to content

Commit 18ce62f

Browse files
committed
Call to ps6000aGetTriggerInfo() and timestamps
1 parent 7245746 commit 18ce62f

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

ps6000aExamples/ps6000aRapidBlockExample.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
import numpy as np
1010
from picosdk.ps6000a import ps6000a as ps
1111
from picosdk.PicoDeviceEnums import picoEnum as enums
12+
from picosdk.PicoDeviceStructs import picoStruct as struct
1213
import matplotlib.pyplot as plt
13-
from picosdk.functions import adc2mV, assert_pico_ok
14+
from picosdk.functions import mV2adc, adc2mV, assert_pico_ok
1415

1516
# Create chandle and status ready for use
1617
chandle = ctypes.c_int16()
@@ -25,7 +26,7 @@
2526
# Set channel A on
2627
# handle = chandle
2728
channelA = enums.PICO_CHANNEL["PICO_CHANNEL_A"]
28-
coupling = enums.PICO_COUPLING["PICO_DC_OHM"]
29+
coupling = enums.PICO_COUPLING["PICO_DC_50OHM"]
2930
channelRange = 5
3031
# analogueOffset = 0 V
3132
bandwidth = enums.PICO_BANDWIDTH_LIMITER["PICO_BW_FULL"]
@@ -53,7 +54,7 @@
5354
direction = enums.PICO_THRESHOLD_DIRECTION["PICO_RISING"]
5455
# delay = 0 s
5556
# autoTriggerMicroSeconds = 1000000 us
56-
status["setSimpleTrigger"] = ps.ps6000aSetSimpleTrigger(chandle, 1, source, (mV2adc(100,channelRange,maxADC), direction, 0, 1000000)
57+
status["setSimpleTrigger"] = ps.ps6000aSetSimpleTrigger(chandle, 1, source, mV2adc(100,channelRange,maxADC), direction, 0, 1000000)
5758
assert_pico_ok(status["setSimpleTrigger"])
5859

5960
# Get fastest available timebase
@@ -173,7 +174,25 @@
173174
status["getValues"] = ps.ps6000aGetValuesBulk(chandle, 0, ctypes.byref(noOfSamples),0, 9, 1, downSampleMode, ctypes.byref(overflow))
174175
assert_pico_ok(status["getValues"])
175176

176-
177+
# Handle = chandle
178+
# triggerInfo = (struct.PICO_TRIGGER_INFO * 10)()
179+
# Fromsegmentindex = 0
180+
# Tosegementindex = 9
181+
triggerInfo = (struct.PICO_TRIGGER_INFO * 10)()
182+
183+
status["GetTriggerInfo"] = ps.ps6000aGetTriggerInfo(chandle, ctypes.byref(triggerInfo), 0, 10)
184+
assert_pico_ok(status["GetTriggerInfo"])
185+
print("TimestampCounter values in samples (only relative timestamps one segment to the next)")
186+
# print("Timestamp samples for 2nd segment (index 1, from segment 0 to 1) = ", triggerInfo(1).timeStampCounter)
187+
print("Printing triggerInfo for segments-")
188+
for i in triggerInfo:
189+
print("segmentIndex is ", i.segmentIndex)
190+
print("PICO_STATUS is ", i.status)
191+
# print("triggerIndex is ", i.triggerIndex)
192+
# print("triggerTime is ", i.triggerTime)
193+
# print("timeUnits is ", i.timeUnits)
194+
print("timeStampCounter is ", i.timeStampCounter)
195+
print("-------------------------------")
177196

178197
# convert ADC counts data to mV
179198
adc2mVChAMax = adc2mV(bufferAMax, channelRange, maxADC)

0 commit comments

Comments
 (0)