ps5000aSetSigGenArbitrary

Post discussions on applications you are writing
Post Reply
francisco.dutra
Newbie
Posts: 0
Joined: Fri Mar 10, 2023 1:06 pm

ps5000aSetSigGenArbitrary

Post by francisco.dutra »

Hello, I am trying to implement a square wave with a duty cycle of 90 percent.
Here is my code:

Code: Select all

        t = np.linspace(0, 1, 1000, endpoint=True)
        awgBuffer = signal.square(2 * np.pi * 1 * t, duty= 0.9)

        awgbufferPointer = awgBuffer.ctypes.data_as(ctypes.POINTER(ctypes.c_int16))
               
        self._status["setSigGenArbitrary"] = ps.ps5000aSetSigGenArbitrary(chandle, 0, 2000000, 0, 0, 0, 0, awgbufferPointer, 1000, 0, 0, 0, 0, 0, 0, 0, 0)
I follow the example in the SDK and I think I understood its implementation. Though when I try to record this signal when it is 1V with a trigger at 500 mV I do not record anything.

Code: Select all

        # Set up single trigger
        # handle = chandle
        # enabled = 1
        source = ps.PS5000A_CHANNEL["PS5000A_CHANNEL_A"]
        threshold = int(mV2adc(500,chARange, maxADC))
        # direction = PS5000A_ABOVE = 0
        # delay = 0 s
        # auto Trigger = 0
        self._status["trigger"] = ps.ps5000aSetSimpleTrigger(chandle, 1, source, threshold, 0, 0, 0)

Also if someone knows how I could do a square wave for 2 to 3 s in 1V it would be nice.

Post Reply