LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWINDOWS SDK

Each time I receive a SDK Kit from a Camera Manufacturer it seems the .LIB, .DLL, and .H  files will not compile and run under LabWINDOWS/CVI. 


The current problem is with a PULNIX A50.h
// Errorcodes returned by the A50/M7 functions
#define ERR_NO_ERROR            0    // Every thing is just fine 🙂
#define ERR_INVALID_PARAMETER    -1    // Function provided with invalid parameter
#define ERR_OPEN_COMPORT        -2    // Unable to open Communication Port
#define ERR_COM_NO_ANSWER        -3    // Camera didn't answer Enq
#define ERR_WRITE_COM            -4    // Error Writing to ComPort
#define ERR_READ_COM            -5    // Error Reading from ComPort
#define ERR_NOT_ONLINE            -6    // Error Using ComPort before init (Not online)
#define ERR_READ_TIMEOUT        -7  // Timeout waiting for answer
#define ERR_INVALID_TRIGGERMODE    -8    // Error setting shutterspeed when trigger "start-stop" or "continues"
#define ERR_WRITE_FILE            -9    // Error opening or writing file
#define ERR_READ_FILE            -10    // Error opening or reading file
#define ERR_ILLEGAL_INI_FILE    -11    // Error i setup/ini-file

#ifndef C_source
#define DllImport    __declspec( dllimport )

extern "C" DllImport int JaiA50InitComm(int CommPort);
extern "C" DllImport int JaiA50ExitComm(int CommPort);
extern "C" DllImport int JaiA50SendCameraData(int CommPort, int cmd, int Data);
extern "C" DllImport int JaiA50GetCameraData(int CommPort, int cmd, int* pData);
#endif

Any help is much appreciated.

JS.

0 Kudos
Message 1 of 3
(3,494 Views)

There are as many ways to do this as there are software engineers who volunteer a solution, Smiley Tongue but as a quick check the try editing the header file as follows: (delete the bits in red, add the bits in green)

#ifndef C_source
#define DllImport    __declspec( dllimport )

extern "C" DllImport int __stdcall JaiA50InitComm(int CommPort);
extern "C" DllImport int __stdcall JaiA50ExitComm(int CommPort);
extern "C" DllImport int __stdcall JaiA50SendCameraData(int CommPort, int cmd, int Data);
extern "C" DllImport int __stdcall JaiA50GetCameraData(int CommPort, int cmd, int* pData);
#endif

If this works you could consider a cleaner approach, but unless you can persuade the suppliers to alter their code I think you will always be left with editing the file one way or another.

JR

0 Kudos
Message 2 of 3
(3,473 Views)
Thanks for your help, I had did it the cheap man's way by just analyzing the messages with a serial analyzer and programming them manually in CVI with the serial writes/reads.  I will try this and remember in the future. 

thanks again,

JS

0 Kudos
Message 3 of 3
(3,459 Views)