NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I change the DLL called by an action statment in Test Stand 3.5 during r

How can I change the DLL called by an action statment in Test Stand 3.5 during run time?
0 Kudos
Message 1 of 8
(4,029 Views)
Hi GoSlow,
 
I think this can be done through the TS API's.
 
1). Create an ActiveX step to read the object reference of the module you wish to dynamically change.  
Automation Server: "NI TestStand API",
Object Reference: "RunState.Sequence.Main["DLLStepYouWishToChange"]"
Object Class: Step
Get Property: Module
Return Value: Locals.ModuleRef
 
2). Create an ActiveX step to set the module path.
Automation Server: "NI TestStand Adapter API",
Object Reference: Locals.ModuleRef
Object Class: CommonCModule
Set Property: ModulePath
newValue: "C:\\YourNewPath\\YourNewDll.dll"
 
Hopefully this will start you off!

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 2 of 8
(4,006 Views)
Hey goslow,
I actually have an example program that I made for another customer that does this as well as lets you change the function that you reference. Take a look at it and let me know if you have any questions!

Lars
Message 3 of 8
(3,999 Views)
Hi Lars,
 

I was using nearly the same method as you (I was just toggling between two DLLS).  What I see when I run my code is that TestStand indicated that it is running DLL1, but it is actually running DLL2. 

 

When I try to run your DLLs, I get "-17004; Could not load DLL or library."  This is DLL not loadable.
Maybe you sent the wrong DLLs.
0 Kudos
Message 4 of 8
(3,961 Views)

Hi goSlow,

Lars' example appears to work for me.

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 5 of 8
(3,949 Views)
Hey goslow,
I also verified that the example I posted works on my computer. Try redownloading it and give it another try. Also, here is a DevZone document that lists some of the causes of that error: http://zone.ni.com/devzone/cda/tut/p/id/3351

Regards,
Lars
0 Kudos
Message 6 of 8
(3,933 Views)
Hi Lars,
 
Still no luck.  This can' t be that hard.  I am not sure what I am doing wrong.  Thanks for checking the Dlls.  What did you use to develop the DLL?  Maybe I am missing some supporting DLLs.
 
Jeff
0 Kudos
Message 7 of 8
(3,920 Views)
Hi Lars,
 
I finally got my version to work.  The key was that the dll had to be unloaded after the step executed.  Thanks for everyone's help.
 
 
0 Kudos
Message 8 of 8
(3,914 Views)