Problem with DLL functions and serial port

3 views (last 30 days)
Nathan
Nathan on 11 Aug 2014
Commented: Philip Borghesani on 12 Aug 2014
I am trying to use a use a dll to control an Ocean Optics monoscan 2000 through a serial port. I am able to successfully load the library and call all of the functions that send information to the device. However, the one function that is supposed to read calibration data from the device returns an error that no device was detected. The GUI works properly, so I know the issue is not with the device itself. Example warnings from loadlibrary include the following, which makes up about half of the warnings when I use the lcc-win32 compiler and less than 1% of the total warnings I get when using Microsoft SDK 7.1.
Type 'DCB' was not found. Defaulting to type error.
Found on line 6207 of input from line 6146 of file C:\\Program Files (x86)\\MATLAB\\R2014a\\sys\\lcc\\include\win.h
Type '_CRITICAL_SECTIONPtr' was not found. Defaulting to type voidPtr.
Found on line 6339 of input from line 6278 of file C:\\Program Files (x86)\\MATLAB\\R2014a\\sys\\lcc\\include\win.h found parens in LowPart ; LONG HighPart ; }; struct { DWORD LowPart ; LONG HighPart ; } u ; long long QuadPart ; } LARGE_INTEGER ,* PLARGE_INTEGER Match: DWORD LowPart ; LONG HighPart ; Final string:LowPart ; LONG HighPart ; }; struct u ; long long QuadPart ; } LARGE_INTEGER ,* PLARGE_INTEGER
Failed to parse type 'union _LARGE_INTEGER { struct { DWORD LowPart ; LONG HighPart ; }; struct { DWORD LowPart ; LONG HighPart ; } u ; long long QuadPart ; } LARGE_INTEGER ,* PLARGE_INTEGER' original input 'union _LARGE_INTEGER { struct { DWORD LowPart ; LONG HighPart ; }; struct { DWORD LowPart ; LONG HighPart ; } u ; long long QuadPart ; } LARGE_INTEGER ,* PLARGE_INTEGER' Found on line 6642 of input from line 6581 of file C:\\Program Files (x86)\\MATLAB\\R2014a\\sys\\lcc\\include\win.h
Type 'LARGE_INTEGER' was not found. Defaulting to type error.
Found on line 7734 of input from line 7673 of file C:\\Program Files (x86)\\MATLAB\\R2014a\\sys\\lcc\\include\win.h
Type 'LARGE_INTEGERPtr' was not found. Defaulting to type voidPtr.
Found on line 7734 of input from line 7673 of file C:\\Program Files (x86)\\MATLAB\\R2014a\\sys\\lcc\\include\win.h
Type 'PROPSHEETPAGEPtr' was not found. Defaulting to type voidPtr.
Found on line 8540 of input from line 8479 of file C:\\Program Files (x86)\\MATLAB\\R2014a\\sys\\lcc\\include\win.h
Type 'PROPSHEETHEADERPtr' was not found. Defaulting to type voidPtr.
Found on line 8563 of input from line 8502 of file C:\\Program Files (x86)\\MATLAB\\R2014a\\sys\\lcc\\include\win.h
Type 'LARGE_INTEGER' was not found. Defaulting to type error.
Found on line 8822 of input from line 8761 of file C:\\Program Files (x86)\\MATLAB\\R2014a\\sys\\lcc\\include\win.h
  1 Comment
Philip Borghesani
Philip Borghesani on 12 Aug 2014
Loading any library that depends on windows.h will produce a large number of warnings. These can be ignored for the most part. Look at the end of the warnings to see if any apply specifically to the function you are trying to call or data types for it's parameters.
To assist you we well need more information. What is the prototype of the function you are trying to call and what does the library documentation say about the required inputs? Please post the matlab code are you attempting to use to make the function call and the output of libfunctions -full for the fuction or better the comment line and definition line for the function in a prototype file generated with the loadlibrary -mfilename option.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!