LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a dll function that does not have any inputs from a VI

Hello all, I'm very new to Labview, I have wraped a dll library using the LVlib wizard and now I am trying to use it in a project.  I have a function that does not take any inputs or return any thing except that a struct is populated with some status information as part of the call.  I am able to draw a StartInterface VI because my void startInterface(const char* configFile, struct status_struct* status) takes the location of a configutation file as an input. But I can not figure out how to connect my Call Library Node to my a function vi that does not have any inputs ( void shutdownInterface(struct status_struct* status)). 

 

Note that the status struct is deffined to be only and out put at the creation of the LVLIB.

 

Thanks, Mike

0 Kudos
Message 1 of 6
(2,897 Views)
Really I suppose this is the same thing as calling a function that does not take any parameters(the status structure may just cause confusion). Does any one know how to call a dll function that does nto take any paramters, such as int getNumberOfWidgets()? Again my problem is that I can not figure out how to wire the Call Library Node to the function.
0 Kudos
Message 2 of 6
(2,867 Views)

A pointer is still an "input", so the function void shutdownInterface(struct status_struct* status) has an input - a pointer to a struct. Usually the term "arguments" are used since this does not provide a connotation of "input" or "output". A function with no arguments... well there's nothing magical about that. In the Parameters tab when you're configuring the Call Library Function function you simply have this:

 

 

Note: You should search these forums on pitfalls of passing structs to DLLs. 

 

Message Edited by smercurio_fc on 02-28-2009 11:25 PM
Message 3 of 6
(2,850 Views)

Hello,

 

It seems that you are trying to do a callback with your code that doesn't have any inputs and doesn't return anything. If you have LV 8.6.1, there is a built in interface for callbacks as you can see in the above call library functions property or in this manual. If you don't have LV 8.6.1, here is a discussion form on how to work around this to implement a callback function.

Message Edited by AAE_7885 on 03-02-2009 10:12 AM
National Instruments
RIO Embedded Hardware PSE

CompactRIO Developers Guide
0 Kudos
Message 4 of 6
(2,822 Views)

Thanks for the responses guys:

   I think I am aware of the conotations of inputs and outputs when I created the lvlib I specified the argument  struct status_struct* status as only an output instead of the default of input and output.

I do not think that I am doing anything as complex as function callbacks. My immediate goal is to have an executable (I have application builder) with two buttons and two three text fields one text field for the input of the config file, two text-fields for a cstring that is contained in the status struct; one button to start the interface and one button to stop the interface. 

 

This is in all likely hood a case of my self being too dense and missing something fundimental 😉  I just can't figure out how to wire the shut down method after I've configured the call library node. See the attached pictures:

 

Download All
0 Kudos
Message 5 of 6
(2,812 Views)
What are those EGSE VIs and why do you want to wire them to the Call Library Functions? Are you trying to force execution order? If so, just use the error cluster. If those VIs don't have an error cluster, then they should. If they don't and you can't modify them, then you need to use a sequence frame.
0 Kudos
Message 6 of 6
(2,786 Views)