Skip to content

Commit 3dc9b5f

Browse files
author
neil.hamilton
committed
add frequency2phase to arbitrary sig gen section
1 parent 1a11348 commit 3dc9b5f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ps2000aExamples/ps2000aSigGen.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,25 +129,32 @@
129129
awgBuffer = np.sin(np.linspace(0,2*math.pi,1024))
130130
awgbufferPointer = awgBuffer.ctypes.data_as(ctypes.POINTER(ctypes.c_int16))
131131

132+
phase = ctypes.c_uint32(0)
133+
134+
status["freq2phase"] = ps.ps2000aSigGenFrequencyToPhase(chandle, 100, 0, 1024, ctypes.byref(phase))
135+
assert_pico_ok(status["freq2phase"])
136+
print(phase.value)
137+
132138
# output custom waveform with peak-to-peak of 2 V and frequency of 10 kHz
133139
# handle = chandle
134140
# offsetVoltage = 0
135141
# pkToPk = 2000000
136-
# startDeltaPhase = 0
142+
# startDeltaPhase = phase
137143
# stopDeltaPhase = 0
138144
# deltaPhaseIncrement = 0
139145
# dwellCount = 0
140146
# *arbitaryWaveform = awgbufferPointer
141147
# arbitaryWaveformSize = 1024
142148
# sweepType = ctypes.c_int32(1) = PS5000A_UP
143149
# operation = 0
150+
# indexMode = 0 = PS2000A_SINGLE
144151
# shots = 0
145152
# sweeps = 0
146153
# triggerType = ctypes.c_int16(0) = PS5000A_SIGGEN_RISING
147154
# triggerSource = ctypes.c_int16(0) = PS5000A_SIGGEN_NONE
148155
# extInThreshold = 0
149156

150-
status["setSigGenArbitrary"] = ps.ps2000aSetSigGenArbitrary(chandle, 0, 2000000, 0, 0, 0, 0, awgbufferPointer, 1024, 0, 0, 0, 0, 0, 0, 0, 0)
157+
status["setSigGenArbitrary"] = ps.ps2000aSetSigGenArbitrary(chandle, 0, 2000000, phase, phase, 0, 0, awgbufferPointer, 1024, 0, 0, 0, 0, 0, 0, 0, 0)
151158
assert_pico_ok(status["setSigGenArbitrary"])
152159

153160
# Pauses the script to show signal

0 commit comments

Comments
 (0)