SDK python - Arbitrary signal generator on p2000

Post general discussions on using our drivers to write your own software here
Post Reply
fenixjose
Newbie
Posts: 0
Joined: Thu Jun 16, 2022 9:24 pm

SDK python - Arbitrary signal generator on p2000

Post by fenixjose »

Arbitrary Signal Generator is not working. On the other hand, built-in generator works fine.
The python code:

Code: Select all

import ctypes
import numpy as np
from picosdk.ps2000 import ps2000 as ps
from picosdk.functions import adc2mV, assert_pico2000_ok

status = {}
status["openUnit"] = ps.ps2000_open_unit()
print(status["openUnit"])
chandle = ctypes.c_int16(status["openUnit"])
print(f' chandle = {chandle}') # Result = 1  - - - > Ok

num_points = 4000
magnitude = 128
arbSignal0 = np.linspace(0, num_points)
arbSignal1 = magnitude*(1+np.sin(arbSignal0 * np.pi * 6/ num_points))
arbSignal=arbSignal0.ctypes.data_as(ctypes.POINTER(ctypes.c_uint8))#   uint8_t      *arbitraryWaveform,

c_offset = ctypes.c_int32(2000)                                 # int32_t  offset
c_pktopk = ctypes.c_uint32(5000)                              # uint32_t pkToPk,
c_startDelta = ctypes.c_uint32(0)                              #   uint32_t startDeltaPhase,
c_stopDelta = ctypes.c_uint32(0)                               #   uint32_t    stopDeltaPhase,
c_deltaIncrement = ctypes.c_uint32(0)                      #   uint32_t    deltaPhaseIncrement,
c_dwell = ctypes.c_uint32(0)                                     #   uint32_t    dwellCount,
c_arbFormSize = ctypes.c_int32(num_points)             #   int32_t       arbitraryWaveformSize,
sweeptype = ctypes.c_int32(1)                                  #   PS2000_SWEEP_TYPE  UP,
sweeps = ctypes.c_uint32(0)                                      #   uint32_t    sweeps
res_signal = ps.ps2000_set_sig_gen_arbitrary(chandle, c_offset, c_pktopk, c_startDelta, c_stopDelta, c_deltaIncrement, c_dwell, arbSignal, c_arbFormSize, sweeptype, sweeps)
print(f'Arbitrary signal = {res_signal}\n') # Result = 1  - - - >Ok
# Thank you for your help in advance.

Abdul
Newbie
Posts: 1
Joined: Mon Jun 13, 2022 12:15 pm

Re: SDK python - Arbitrary signal generator on p2000

Post by Abdul »

I am having the exact same problem but with p4000. The built generator works fine. the arbitraryWF generator produces only noise.

Post Reply