I have tried everything with this device to get it to work with c code to enable me to read the volts from channel 1 or any other channel. I have to make it a c file.
The code that gives me a error is at all the “FUNCTION __stdcall” lines in the code below:
#include <stdio.h>
#ifdef __cplusplus
extern “C” { /* Assume C declarations for C++ */ #endif
#define FUNCTION __declspec(dllimport)
FUNCTION __stdcall StartDevice();
FUNCTION __stdcall StopDevice();
FUNCTION __stdcall LEDon();
FUNCTION __stdcall LEDoff();
FUNCTION __stdcall ReadData(int *ptr);
FUNCTION __stdcall SetGain(int Channel, int Gain);
#ifdef __cplusplus
} #endif
The error is:
Conflicting types for StartDevice and so on for each of the function calls.
Please help me to get c code to work that I can just read the volts from this device channels. We have been struggling with this problem a while now and was told that your devices are top notch. Now it has been almost a year and our clients are frustrated.
[code]#ifdef __cplusplus
extern “C” { /* Assume C declarations for C++ */ #endif
#define FUNCTION __declspec(dllimport)
FUNCTION void __stdcall StartDevice();
FUNCTION void __stdcall StopDevice();
FUNCTION void __stdcall LEDon();
FUNCTION void __stdcall LEDoff();
FUNCTION void __stdcall ReadData(int *ptr);
FUNCTION void __stdcall SetGain(int Channel, int Gain);
Thank you for the quick reply. It did work but I am still unable to read the volts from the device in C.
I am new to C code so please bear with me. I can code anything in VB and C# and Java but C is new to me and using C is the only way to get the Volts from the sensor into the KMotionCNC G-Code we are running. I specify a C file that runs when I call an assigned M-Code.
The code I am using for the C file must return just the volts from the sensor each time it executes:
The SetGain function gives me a error “Undefined reference to _imp__SetGain@8”
I am probably far off but I need some guidance as google does not help me anymore and it only brings me to this website if I seek information regarding this issue.
Thank you very much for taking the time to help me.