From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i call a .dll file dynamically in the teststand with the specified functions

Hi,

I am trying to load a .dll file in the teststand with defined fuction. for example let us take an instrument.dll wich should be called in the teststand dynamically defining its fucntions like ( initialize, Close, read, Configure) .

The case is related to an example in the LabView, as shown in attached picture.

In the Picture we are calling a VI reference of an instrument driver vi, I need to implement the same in teststand instead of instrument driver vi i need to call the dll reference in the teststand. Please advice me if there is a way to do the obove mentioned case in teststand.

0 Kudos
Message 1 of 2
(4,515 Views)

Hi,

 

Assuming the function name and its properties dont change with dll.You want to dynamically change A.dll to B.dll dynamically. 

 

The DLL path and name is stored in that step.properties (step.Sdata.call.LIbpath).You need to enable  stationoptions --> Preferences --> show hidden properties.

 

1)Call A.dll with the function in a action step.Configure all the parameters of the function.

2) Change the step property to load dynamically and unload after step executes.

3) In the previous step add a statement "RunState.NextStep.TS.SData.Call.LibPath = B.dll"

 

This should change the DLL dynamicallly and in the next step new dll should run.( I could not try this out but it should work.)

Hope this helps.

 

Ravi

www.Testamatic.com

 

Ravi

0 Kudos
Message 2 of 2
(4,095 Views)