10-28-2015 04:19 AM
Hello,
in C# i created a DLL for an instrument with functions like Initialize, SetVoltage, Close.
In the Initialize function i create the object for this session with:
RM = new ResourceManager();
Instrument = new FormattedIO488();
Now i put the Initialize function in TestStand 2014SP1 as a .Net-Module-NumericLimitTest.
When opening the properties of my new step in the Type-Editor then there is a button "Default Module" where i can select the function of the C#-DLL.
All paramaters are shown (like VISA-Address) and also an additional parameter "Return Value" Object Reference" OUT which was added by TestStand.
-> I save this value in a StationGlobal.
Question is now:
If i have more than one instrument of the same type (means two or more Initialize-calls) how can i pass the saved references to the next function (SetVoltage) so that is executed on the correct instrument?
Thanks for help
Solved! Go to Solution.
10-28-2015 05:06 AM
When i do this in C# then i have to execute a "new" to the object.
Like
MyDMM.MyDMM INST_A = new MyDMM.MyDMM();
MyDMM.MyDMM INST_B = new MyDMM.MyDMM();
MyDMM.MyDMM INST_C = new MyDMM.MyDMM();
...
...
INST_A.Initialize(IPaddress,..)
INST_B.Initialize(IPaddress,..)
INST_B.Initialize(IPaddress,..)
How can i do this "new" in TestStand? And how would i pass the object-names to the teststeps?
Thanks
10-28-2015 06:19 AM
Solved:
Select "Use Existing Object" un -Net Invocation and pass the saved reference in there.