Issue when changing pkTopk value in signal generator

Post your .Net discussions here
Post Reply
Posts: 2
Joined: Fri Jan 05, 2018 9:31 am

Issue when changing pkTopk value in signal generator

Post by StefanoP »


I am writing an application using a 5242DMSO PicoScope and the .NET SDK. I want to output symmetric (around 0V) square wave pulses using the signal generator.

Basically the output should be 0 until the trigger, +A, -A and finally back to 0. I achieve that using a custom waveform of length 3 with values A,-A,0 where A is the maximum value I get from SigGenArbitraryMinMaxValues. I then set the peak to peak value using the pkTopk argument in SetSigGenBuiltInV2.

The problem I have is that this works fine as long as I don't change the value of pkTopk between calls. The signal generator is triggered correctly (from the scope, as I set it up) and the waveform starts at the trigger point. I can call SetSigGenBuiltInV2 multiple times without problems.

However, if I call SetSigGenBuiltInV2 with a different pkTopk argument, the sig gen output immediately goes to the positive value and stays there until I trigger the waveform.

I expected the sig gen output to stay at the last data point of the previous waveform (in my case, 0) until triggered. I tried some workaround, e.g. setting manually a 0 output waveform before my pulse, or stopping the scope. Nothing seems to prevent the sig gen output to go to the first value as soon as I call SetSigGenBuiltInV2.

Here is a code snippet:

Code: Select all

short[] waveform = new[]
                                          offsetVoltage: 0,
                                          pkTopk: 2*Amplitude,
                                          startDeltaPhase: deltaPhase,
                                          stopDeltaPhase: deltaPhase,
                                          deltaPhaseIncrement: 0,
                                          dwellCount: 0,
                                          arbitaryWaveform: waveform,
                                          arbitaryWaveformSize: waveform.Length,
                                          sweepType: Imports.SweepType.PS5000A_UP,
                                          operation: Imports.ExtraOperations.PS5000A_ES_OFF,
                                          indexMode: Imports.IndexMode.PS5000A_SINGLE,
                                          shots: 1,
                                          sweeps: 0,
                                          triggerType: Imports.SigGenTrigType.PS5000A_SIGGEN_RISING,
                                          triggerSource: Imports.SigGenTrigSource.PS5000A_SIGGEN_SCOPE_TRIG,
                                          extInThreshold: 0);

Post Reply