Test and Measurement Forum

DrDAQ - first step: open unit

Post your C and C++ discussions here

DrDAQ - first step: open unit

Postby Tamas » Thu Jun 18, 2015 12:57 pm

I'm working on a project which involves using a DrDAQ data logger connected to a Win 7 PC to count voltage spikes over long periods of time (possibly weeks). I have chosen to use C to keep it simple so there would be no need to have Matlab or Labview on the computer. I downloaded the appropriate files "usbDrDaqApi.h", "usbdrdaq.lib" to build the project. As the first step I'd like to simply connect to DrDAQ.
Code: Select all
#include<stdio.h>
#include<windows.h>
#include "D:\RESEARCH\Picolog\picoStatus.h"
#include "D:\RESEARCH\Picolog\usbDrDaqApi.h"

int16_t            g_handle;
PICO_STATUS         status;

main()
{
    printf ("\nPicoLog test 01\nOpening device...\n");
    status = UsbDrDaqOpenUnit(&g_handle);
}


I'm using Dev-C++ to compile the above code which gives me the linking error : " undefined reference to `_imp__UsbDrDaqOpenUnit@4' ".

I must have made a very basic mistake if even this simple code fails to compile. Thanks for your suggestions in advance.
Tamas
Newbie
 
Posts: 0
Joined: Thu Jun 18, 2015 12:28 pm

Re: DrDAQ - first step: open unit

Postby Hitesh » Mon Jun 22, 2015 12:20 pm

Hi Tamas,

It sounds like the compiler cannot find the lib file. Have you added the .lib file to your project?

It's also good practise to call the UsbDrDaqCloseUnit function before exiting your program in order for the driver to release the connection to the device.

Regards,
Hitesh

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


Return to C and C++

Who is online

Users browsing this forum: No registered users and 2 guests