LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call a defined dll-function with various kinds of data-types

Trying to configure parameters with several data types and call a defined dll-function, I'm having problems with accessing this dll. The system crashes and debugging learns me, access violation had take place. The function I'm trying to assign has the following syntax:

BOOL OpenBoard4520 (LONG DeviceNumber, BOOL LoadDevice, LPSTR szBuf, BoardConfig boardconfig).

With parameters:
DeviceNumber: Device number to load,
LoadDevice: Load/not load the WinRT driver,
szBuf: message buffer to return error message,
boardconfig: Pointer to a BoardConfig structure to return configuration information about the board. Argument is used for display OS resources allocated to the board. I don't know either how to pass
NULL for this argument, since I do not need this information.

My question is: can someone provide me with a solution, or perhaps an example-program to call this defined dll Driver API Function properly, without a system crash?

Thanks for your help!
0 Kudos
Message 1 of 2
(2,354 Views)
Hi Wolfie,

First, it may be useful to check these articles:

- "An Overview of Accessing DLLs or Shared Libraries from LabVIEW" [http://zone.ni.com/devzone/conceptd.nsf/webmain/B26A875ACA51C567862567CA0055FF24?opendocument&node=DZ52048_US]

- "Passing a Variety of Data Types from DLL to LabVIEW
" [http://zone.ni.com/devzone/explprog.nsf/webmain/9E21592A5F39238C862569880064D694?opendocument&node=DZ52048_US]

Second, your problems are probably related to szBuf and boardconfig ... you have to take care to have a large enough input to contain the output value (for example, if your error message 'szbuf' is maximum 50 characters long, wire as an input a string containing more than 50). The same for boardconfig structure.
Let us know if you still have probl
ems.

Hope this helps
0 Kudos
Message 2 of 2
(2,354 Views)