LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pointer in inpout output for external DLL

Hi all,

 

I am using Labview 2011.  I want to access a couple of functions in an external DLL. From the documentation, the function are defined as:

  1. int function1(const char *Param1);
  2. int function2(char **Param2);
  3. int function3(int *Param3);

 

what I have to use as inputs and outputs in the Call library function Node?

 

Regards,

 

Cedric 

 

0 Kudos
Message 1 of 3
(2,925 Views)

Hi Cedric,

 

I would take a look at this example for information on calling dlls using the Call Library Function Node:

 

https://decibel.ni.com/content/docs/DOC-9069

 

Keep in mind you will need to know what language the dll was written in.

Justin M.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(2,883 Views)

The C syntax is notorously inadequate to fully describe all aspects of function parameters.

 

For instance your first protoype could mean that you have to pass in a single char (uInt8) passed by reference (pointer) or it could be a string character array. For a string character array you need to know if the parameter is an input to the function or an output. For an input you simply pass the string to the parameter configured as C string pointer. For an output string character array you also configure it as C string pointer but also need to know how many characters the string character array should be preallocated with and either initialize a string constant on the diagram with that many characters or configure the minimum size in the Call Library Node. As you can see this first function prototype already has several possible configurations, depending on what the DLL programmer implemented in that function.

 

Your second function prototype also can have ambiguous meaning but basically all of them can NOT be directly configured in the Call Library Node.

 

The third is pretty much the same as the first except that here you have a 32 bit integer instead of an 8 bit character as array element.

 

Realistically if you you have to ask these questions here you will have a lot of trouble to make 1) and 3) work reliably and will almost certainly fail on 2).

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(2,856 Views)