usb DrDAQ signal generator in excel

Post your VB and VBA discussions here
Post Reply
paul_Leslie
Newbie
Posts: 0
Joined: Fri Sep 16, 2011 12:58 pm

usb DrDAQ signal generator in excel

Post by paul_Leslie »

i'm trying to use the sig gen function in excel (its the only thing i have to program in) and cant get any kind of output, will this even work or am i missing something important from the code, the module is as follows

Declare Function UsbDrDaqOpenUnit Lib "USBDrDAQ.dll" (ByRef handle As Integer) As Long
Declare Function UsbDrDaqSetSigGenBuiltIn Lib "USBDrDAQ.dll" (ByVal handle As Integer, ByVal offsetVoltage As Long, ByVal pkToPk As Long, ByVal frequency As Long, ByVal waveType As Integer) As Integer

'(The above bits are both on one line each but this is how it copies and pastes)

______________________________________________________________________________
Sub Button11_Click()

Dim handle As Integer


Call UsbDrDaqOpenUnit(handle)
Call UsbDrDaqSetSigGenBuiltIn(handle, 0, 1000000, 440, 0)

End Sub

most of the sig gen function was taken from some code using a different scope with some other variables and i dont know if the waveType is either diclared or used the same

and help would be much appreciated

Hitesh

Re: usb DrDAQ signal generator in excel

Post by Hitesh »

Hi Paul,

The signal generator function should work.

Looking at the Programmer's Guide (see p26 - 3.5.17 UsbDrDaqSetSigGenBuiltIn), I would suggest that the line matches the input types for frequency - it needs to be a 2-bit number:

Declare Function UsbDrDaqSetSigGenBuiltIn Lib "USBDrDAQ.dll" (ByVal handle As Integer, ByVal offsetVoltage As Long, ByVal pkToPk As Long, ByVal frequency As Integer, ByVal waveType As Integer) As Integer

Have you tested the device in PicoScope to check if the signal generator itself is working?

If you need further assistance, please e-mail your source code file to support@picotech.com.

Regards,

Post Reply