DrDAQ - first step: open unit

Post your C and C++ discussions here
Post Reply
Tamas
Newbie
Posts: 0
Joined: Thu Jun 18, 2015 12:28 pm

DrDAQ - first step: open unit

Post by 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.

Hitesh
Site Admin
Site Admin
Posts: 2827
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: DrDAQ - first step: open unit

Post by 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 Support Engineer

Post Reply