Interfacing K8055 with Matlab not working

I have been trying get this m-file supplied at hackhole.blogspot.com/2007/11/in … -with.html to work. It is returning the following error:

[code]Channel (0-3): 0
Status:Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(…)

In loadlibrary at 394
In K8055_Connect at 8
Error loading library intermediate output follows.
The actual error is at the end of this output.


Type ‘’ was not found. Defaulting to type error.

Found on line 23 of input from line 22 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 25 of input from line 24 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 26 of input from line 25 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 27 of input from line 26 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 28 of input from line 27 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 29 of input from line 28 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 30 of input from line 29 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 31 of input from line 30 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 32 of input from line 31 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 33 of input from line 32 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 34 of input from line 33 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 35 of input from line 34 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 36 of input from line 35 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 40 of input from line 39 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 41 of input from line 40 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h

Type ‘’ was not found. Defaulting to type error.

Found on line 43 of input from line 42 of file C:\Program Files\MATLAB\R2009b\Projects\K8055_INTERFACE\source_code\K8055D.h


??? Error using ==> loadlibrary at 422
Building K8055D_thunk_pcwin64 failed. Compiler output is:
K8055D_thunk_pcwin64.c
K8055D_thunk_pcwin64.c(62) : error C2059: syntax error : ‘)’
K8055D_thunk_pcwin64.c(74) : error C2059: syntax error : ‘)’
K8055D_thunk_pcwin64.c(83) : error C2059: syntax error : ‘)’
K8055D_thunk_pcwin64.c(87) : error C2061: syntax error : identifier ‘boollongThunk’
K8055D_thunk_pcwin64.c(87) : error C2059: syntax error : ‘;’
K8055D_thunk_pcwin64.c(87) : error C2059: syntax error : ‘type’

Error in ==> K8055_Connect at 8
loadlibrary(‘K8055D.dll’,‘K8055D.h’); %
Loads DLL and H file[/code]

I’m running Windows 7 64-bit Ultimate and Matlab r2009b 7.9 and visual studio 2008 sp1
I have tried using the updated .dll and .h files that velleman provieds and still no luck.

Any help would be appreciated. Thanks

I have the same problem, so i can’t help. But if you solved the problem by now i really like to hear about it. :slight_smile:

This problem looks similar as in this thread:
viewtopic.php?f=3&t=3787&

The solution was to change in the .h file all the

FUNCTION __stdcallto

FUNCTION void __stdcall 

You may try this one:

[code]
#ifdef __cplusplus
extern “C” {
#endif

#define FUNCTION __declspec(dllexport)

FUNCTION long __stdcall OpenDevice(long CardAddress);
FUNCTION void __stdcall CloseDevice();
FUNCTION long __stdcall ReadAnalogChannel(long Channel);
FUNCTION void __stdcall ReadAllAnalog(long *Data1, long *Data2);
FUNCTION void __stdcall OutputAnalogChannel(long Channel, long Data);
FUNCTION void __stdcall OutputAllAnalog(long Data1, long Data2);
FUNCTION void __stdcall ClearAnalogChannel(long Channel);
FUNCTION void __stdcall ClearAllAnalog();
FUNCTION void __stdcall SetAnalogChannel(long Channel);
FUNCTION void __stdcall SetAllAnalog();
FUNCTION void __stdcall WriteAllDigital(long Data);
FUNCTION void __stdcall ClearDigitalChannel(long Channel);
FUNCTION void __stdcall ClearAllDigital();
FUNCTION void __stdcall SetDigitalChannel(long Channel);
FUNCTION void __stdcall SetAllDigital();
FUNCTION bool __stdcall ReadDigitalChannel(long Channel);
FUNCTION long __stdcall ReadAllDigital();
FUNCTION long __stdcall ReadCounter(long CounterNr);
FUNCTION void __stdcall ResetCounter(long CounterNr);
FUNCTION void __stdcall SetCounterDebounceTime(long CounterNr, long DebounceTime);

FUNCTION void __stdcall Version();
FUNCTION long __stdcall SearchDevices();
FUNCTION long __stdcall SetCurrentDevice(long lngCardAddress);

#ifdef __cplusplus
}
#endif[/code]

Oops…
I did now see that my problem was in an earlier stage in the “loadlibrary” function.

>> K8055_Connect Channel (0-3): 0 Status:??? Error using ==> loadlibrary at 367 Failed to preprocess the input file. Output from preprocessor is:'cl' is not recognized as an internal or external command, operable program or batch file.Well I guess i get to this problem later on… :stuck_out_tongue: