ps2000 set sig gen built in not functioning

Post your VB and VBA discussions here
Post Reply
LabGuyJohn
Newbie
Posts: 0
Joined: Fri Jun 26, 2015 9:52 pm

ps2000 set sig gen built in not functioning

Post by LabGuyJohn »

Hi all
I've searched around looking for a solution to this... to tell the truth I havent a clue what the problem is. I've coppied code that others claim to be functioning and it still returns a "1". According to the SDK a value of "0" means its working.

Thanks for any help!

Declaration

Code: Select all

Declare Function ps2000_set_sig_gen_built_in Lib "ps2000.dll" (ByVal handle As Integer, ByVal offsetVoltage As Long, ByVal pkToPk As Long, ByVal waveType As Integer, ByVal startFrequency As Single, ByVal stopFrequency As Single, ByVal incriment As Single, ByVal dwellTime As Single, ByVal sweepType As Integer, ByVal sweeps As Long) As Integer
Implementation

Code: Select all

Call ps2000_set_sig_gen_built_in(ps2000_handle,0, 800000, 0, 0, 50000, 0, 0, 0, 0)
also for error tracking I used

Code: Select all

Dim gensig As Integer
gensig = ps2000_set_sig_gen_built_in(ps2000_handle,0, 800000, 0, 0, 50000, 0, 0, 0, 0)
MsgBox("gensig return: " + gensig)

Hitesh

Re: ps2000 set sig gen built in not functioning

Post by Hitesh »

Hi LabGuyJohn,

Have you tried changing the startFrequency value to a non-zero value?

To output a waveform with constant frequency, set the start and stop frequency to the same value.

Regards,

LabGuyJohn
Newbie
Posts: 0
Joined: Fri Jun 26, 2015 9:52 pm

Re: ps2000 set sig gen built in not functioning

Post by LabGuyJohn »

Hey,

Yes I have tried setting the Initial frequency the same as the final:

Code: Select all

gensig =  ps2000_set_sig_gen_built_in(ps2000_handle,0, 800000, 0, 50000, 50000, 0, 0, 0, 0)
Still returning "1"

Thanks
John

Hitesh

Re: ps2000 set sig gen built in not functioning

Post by Hitesh »

Hi John,

A status code of 1 indicates a successful execution of the function - the status codes returned by this driver are different to most of the other PicoScope drivers which use the status codes defined in the picoStatus.h header file.

How are you verifying the output of the signal generator.

You may wish to declare the waveType and sweepType as 'Long' data types.

Regards,

LabGuyJohn
Newbie
Posts: 0
Joined: Fri Jun 26, 2015 9:52 pm

Re: ps2000 set sig gen built in not functioning

Post by LabGuyJohn »

Hi,

I have it connected to an oscilloscope. The SDK states that it returns "0: if successful" and an "Error code: if failed". I made the recommend changes in the Declaration. Still not functioning. I've tested the sig gen using pico6 and it works there.


Thanks
John

Hitesh

Re: ps2000 set sig gen built in not functioning

Post by Hitesh »

Hi John,

Which device are you using and which Programmer's Guide?

Referring to the section 6.29 (ps2000_set_sig_gen_built_in) in the Programmer's Guide this shows the following for the return values:
0: if one of the parameters is out of range.
non-zero: if successful.
Try setting the frequency and other float values as a decimal value e.g. 50000.0

Regards,

Post Reply