03-26-2007 10:53 AM
03-26-2007 12:06 PM
@Oliveira wrote:
What I need to do is an application that links the external library dinamically. The user will choose the data source that he wants to monitor and the software will create the link in this time.All external libraries have the same patterns of parameters and the returned values are in the same type.
When the user chooses the data source that he wants to monitor, U pass a Str constant, specifying the Dll function for that particular thing to chosen to be monitored by the user, as the first input to the Dll. The only change to be made will be to include an input in the Dll that can accept this Str constant ( respective function name ) as one input ( probably the first one ).
Hope this helps Ur work to get proceeded...
03-26-2007 01:34 PM - edited 03-26-2007 01:34 PM
Message Edited by Oliveira on 03-26-2007 01:34 PM
03-26-2007 04:28 PM
03-26-2007 11:19 PM
@Oliveira wrote:
Following the way that you explain, I will have to develop a interface, maybe using C. Do you have any idea in how to solve this problem using only the Labview features?
Thank you in advance.
Message Edited by Oliveira on 03-26-2007 01:34 PM
What I had told U was itself LabVIEW feature. What U ve to do is make one more inout in the Dll for the Function name as a Str or a Path to get it loaded into memory dynamically during run-time only. This will naturally happen in Ur code because U ve told us that the user himself is going to choose the corresponding functionality.
So, if the choice is thro' a menu ring, for example, all U ve to do is for each item of the ring wired inside a case structure will be sitting these corresponding Str constant or Path constant, which in turn will be wired to the first input of the Dll (NOT necessarily first). This ll invoke the corresp[onding function of the Dll or the corresponding Dll itself, whichever suits best Ur application.
Why I'm telling U this is, in my project, I'm following this methodology only to invoke differerent functions for various H/W modules, but that re present only in the same Dll itself. The parameter numbers & their order are the same for the diff cards. So,we vr got the Dll function name as the first input of the Dll. We use Path instead of Str because when LV builds the EXE, it puts all the necessary Dlls in the code into a folder called "data" that is created in the directory where U build the EXE (for eg, Desktop).
Then U can copy Ur application to wherever U wish to...
On the other hand, U can tell LV where it needs to install Ur application if U create a installer for it.
If U re working in <=LV8.0, this is the only st fwd procedure to acheive things as U want now.
Only from LV8.2, U can import the Dlls by using the Export/Import Dll wizard directly into LV as sub-VIs & perform dynamically loading them alike VIs using the VI server method (using Call by Reference node).
Hope this explains thing in clear detail to U.