|
133 | 133 |
|
134 | 134 | status["freq2phase"] = ps.ps2000aSigGenFrequencyToPhase(chandle, 100, 0, 1024, ctypes.byref(phase)) |
135 | 135 | assert_pico_ok(status["freq2phase"]) |
136 | | -print(phase.value) |
137 | 136 |
|
138 | 137 | # output custom waveform with peak-to-peak of 2 V and frequency of 10 kHz |
139 | 138 | # handle = chandle |
|
160 | 159 | # Pauses the script to show signal |
161 | 160 | time.sleep(36) |
162 | 161 |
|
| 162 | +# output a custom binary sequence from the AWG |
| 163 | +# create a binary buffer for AWG |
| 164 | +binaryBuffer = [0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,1,1,0] |
| 165 | +cBinaryBuffer = (ctypes.c_int16*len(binaryBuffer))(*binaryBuffer) |
| 166 | +binarybufferPointer = ctypes.byref(cBinaryBuffer) |
| 167 | + |
| 168 | +phase2 = ctypes.c_uint32(0) |
| 169 | + |
| 170 | +status["freq2phase"] = ps.ps2000aSigGenFrequencyToPhase(chandle, 10, 0, 1024, ctypes.byref(phase2)) |
| 171 | +assert_pico_ok(status["freq2phase"]) |
| 172 | + |
| 173 | + |
| 174 | +# output custom waveform with peak-to-peak of 2 V and frequency of 10 kHz |
| 175 | +# handle = chandle |
| 176 | +# offsetVoltage = 0 |
| 177 | +# pkToPk = 2000000 |
| 178 | +# startDeltaPhase = phase |
| 179 | +# stopDeltaPhase = 0 |
| 180 | +# deltaPhaseIncrement = 0 |
| 181 | +# dwellCount = 0 |
| 182 | +# *arbitaryWaveform = awgbufferPointer |
| 183 | +# arbitaryWaveformSize = 1024 |
| 184 | +# sweepType = ctypes.c_int32(1) = PS5000A_UP |
| 185 | +# operation = 0 |
| 186 | +# indexMode = 0 = PS2000A_SINGLE |
| 187 | +# shots = 0 |
| 188 | +# sweeps = 0 |
| 189 | +# triggerType = ctypes.c_int16(0) = PS5000A_SIGGEN_RISING |
| 190 | +# triggerSource = ctypes.c_int16(0) = PS5000A_SIGGEN_NONE |
| 191 | +# extInThreshold = 0 |
| 192 | + |
| 193 | +status["setSigGenArbitrary"] = ps.ps2000aSetSigGenArbitrary(chandle, 0, 2000000, phase2, phase2, 0, 0, binarybufferPointer, len(cBinaryBuffer), 0, 0, 0, 0, 0, 0, 0, 0) |
| 194 | +assert_pico_ok(status["setSigGenArbitrary"]) |
| 195 | + |
163 | 196 | # Closes the unit |
164 | 197 | # Handle = chandle |
165 | 198 | status["close"] = ps.ps2000aCloseUnit(chandle) |
|
0 commit comments