Test and Measurement Forum

ps2000SetSigGenBuiltIn Declaration and Function Call

Post your VB and VBA discussions here

ps2000SetSigGenBuiltIn Declaration and Function Call

Postby Bertl » Thu Nov 26, 2009 9:22 pm

Hi, I've just got my picoscope 2203 and got the Excel and VB6 example running.

Now I want to write a program, that changes the freq. of the "Signal Out" waits, measures, changes the freq. waits, measures ...

Now the problem. I haven't found an VB example for the "Singnal Out". I've tried it this way, but in runtime the error 453 "Can't find DLL entry point ps2000SetSigGenBuiltIn in C:\ps2000.dll" appears.

Can anyone help me ?

This is how I've tried it:

################################################

Declare Function ps2000SetSigGenBuiltIn Lib "c:\ps2000.dll" (ByVal handle As Integer, _
ByVal offsetVoltage As Long, _
ByVal pkToPk As Long, _
ByVal waveType As Integer, _
ByVal startFrequency As Double, _
ByVal stopFrequency As Double, _
ByVal increment As Double, _
ByVal dwellTime As Double, _
ByVal sweepType As Double, _
ByVal sweeps As Long) As Integer



################################################

Call ps2000SetSigGenBuiltIn(ps2000_handle, 0, 1000000, 0, 1000, 2000, 10, 10, 0, 1)
Bertl
 

Re: ps2000SetSigGenBuiltIn Declaration and Function Call

Postby Robin » Fri Nov 27, 2009 12:57 pm

Hi

The function name is ps2000_set_sig_gen_built_in.

The documentation is a bit confusing as the sub-heading is ps2000SetSigGenBuiltIn.

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: ps2000SetSigGenBuiltIn Declaration and Function Call

Postby Bertl » Fri Nov 27, 2009 9:00 pm

Hi Robin,

thank you !!! Now it's working after fixing some other errors. Her is the code that works:

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 increment As Single, _
ByVal dwellTime As Single, _
ByVal sweepType As Integer, _
ByVal sweeps As Long) As Integer

' Send out a sine wave with 50khz
Call ps2000_set_sig_gen_built_in(ps2000_handle, 0, 800000, 0, 0, 50000, 0, 0, 0, 0)
Bertl
 


Return to VB and VBA (Excel, Access)

Who is online

Users browsing this forum: No registered users and 0 guests