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 » Mon Jun 29, 2015 9:52 pm

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
Site Admin
Site Admin
Posts: 2845
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: ps2000 set sig gen built in not functioning

Post by Hitesh » Mon Jul 06, 2015 1:28 pm

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,
Hitesh

Technical Support Engineer

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

Re: ps2000 set sig gen built in not functioning

Post by LabGuyJohn » Mon Jul 06, 2015 7:04 pm

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
Site Admin
Site Admin
Posts: 2845
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: ps2000 set sig gen built in not functioning

Post by Hitesh » Tue Jul 07, 2015 7:55 am

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,
Hitesh

Technical Support Engineer

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

Re: ps2000 set sig gen built in not functioning

Post by LabGuyJohn » Wed Jul 08, 2015 3:08 pm

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
Site Admin
Site Admin
Posts: 2845
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: ps2000 set sig gen built in not functioning

Post by Hitesh » Wed Jul 08, 2015 3:48 pm

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,
Hitesh

Technical Support Engineer

Post Reply