Test and Measurement Forum

Signal generator 3204B

Post your .Net discussions here

Signal generator 3204B

Postby Cerealkiller » Wed Jul 11, 2012 10:12 am

Hello,
I want to develop an application to use the built-in signal generator of the mentioned device in VB.Net. The code for activation of the generator works fine but I did not find any possibility to turn it off again without disconnecting the device.

The old programming guide to the 3000 series tells that setting the frequency to 0 should turn of the signal gen but with the ps3000a.dll and the new pg this seems not to work any longer. Does anybody have any suggestions for pausing or stopping the signal generator while staying connected with the scope?

I am posting the code I am using at the moment to turn on the generator. Maybe I am doing something wrong.
Code: Select all
Private Shared Function SetSignalGenerator(amplitude As UInteger, waveType As Short, frequency As Single) As Short

        Dim ampPP As UInteger = amplitude
        Dim wType As Short = waveType
        Dim offsetV As Integer = 0
        Dim incr As Single = 0.0F
        Dim dwellT As Single = 0.0F
        Dim swType As Short = Nothing
        Dim whiteN As Short = 0
        Dim shts As UInteger = 0
        Dim swps As UInteger = 0
        Dim trigTp As Short = SignalGeneratorTriggerType.GateHigh
        Dim trigSrce As Short = SignalGeneratorTriggerSource.None
        Dim extInThr As Short = 1000


        Return DriverHandling.SetSignalGenerator(_handle, offsetV, ampPP, wType, frequency, frequency, incr, dwellT, swType, whiteN, shts, swps, trigTp, trigSrce, extInThr)

    End Function


Thanks a lot for your help, Cereal
Cerealkiller
Newbie
 
Posts: 0
Joined: Wed Jul 11, 2012 10:01 am

Re: Signal generator 3204B

Postby Hitesh » Wed Jul 11, 2012 1:49 pm

Hi Cereal,

Try calling the signal generator function with the pkToPk value set to 0 and the waveform type set to PS3000A_DC_VOLTAGE (numeric value 8 ).

If you were using the arbitrary waveform generator, then you would also set the waveform buffer size to 0.

Hope this helps.


Ps. Interesting username - hope you find the solution 'Just Right'! :D (other cereals are also available... :wink: )
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Signal generator 3204B

Postby Cerealkiller » Wed Jul 11, 2012 2:41 pm

Wow Hitesh,

it worked! Great! I already had the idea to set the pkToPk value to 0 but with a square wave I got an error code from the scope. In an other thread somebody wrote that the value has to be always between 500mV und 4V that is why I thought that these values are always the same for each type of wave. It seems to me that the value depends directly from the wave type but I did not found anything about that in the programming guide. Without setting the wave to DC_Voltage turning off the generator did not work.

Many thanks for your help!
Cerealkiller
Newbie
 
Posts: 0
Joined: Wed Jul 11, 2012 10:01 am

Re: Signal generator 3204B

Postby Hitesh » Wed Jul 11, 2012 4:51 pm

Hi,

No problem - glad to hear it resolved the issue.

The peak to peak voltage of a waveform can be from 0 to 4V, but if you apply an offset it will still be clipped at +/-2V.

Ps. Would have been interesting if your application involved 'cereal' decoding (I'll stop there :D ).
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 0 guests