NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I have a module work across sequence files?

I have a "top level" sequence file that executes several sub-sequence files.  In the Setup tab for the top level sequence file, I have an Action that specifies a .NET module (a DLL written using C#), and it creates an object and calls a method on that object to initialize it with the SequenceContext.  This module allows us to log in to one of our web sites and click on links and submit forms.  So after that first Action, I have another Action that invokes a method on the module to go to the login page of our web site.  Then there's another Action that invokes a method on the module to fill in the username/password and login to the web site.
 
Then in the sub-sequence files, I have Actions that invoke methods on the module to do various things within the web site.  However, this setup in TestStand does not work.  When I try to execute the top level sequence file, I get an error when it tries to execute the first Action in a sub-sequence file that specifies the module:
 
Error: The object specified in the class reference is not a .NET object.
Since you are not creating an object, this must be a .NET object. [Error Code: -17300, Value invalid or out of range.]
 
It looks like in each sub-sequence file I need to start out with an Action that creates the object.  I cannot just have Actions that assume the object has already been created.  But then this means that in each sub-sequence file, I will need to have Actions that go to the login page and log in to our web site.  I would like to do that only in the top level sequence file.  Is this possible?
 
0 Kudos
Message 1 of 6
(3,703 Views)
Hi,

What type of Object are you creating?  Is it a TestStand object?  Is the subsequence in a separate sequence file or in the same sequence file as the main sequence?  Also, are you calling the subsequence in a new thread, a new execution, or neither. 

These will help me figure out how to get this to work.  Basically, we need to find out how to pass a reference of the object or a handle from the object to the subsequence.
0 Kudos
Message 2 of 6
(3,657 Views)
The object is a DLL created using Visual C# .NET.  The subsequence is in a separate file.  The Step that calls the subsequence is an Instance of Type 'SequenceCall', and the "Multithreading and Remote Execution" is set to None.

0 Kudos
Message 3 of 6
(3,652 Views)
Hi,

Are you passing the object from the main sequence to the subsequence as a parameter?  If not, try passing it as a parameter and let me know how that works.
0 Kudos
Message 4 of 6
(3,617 Views)
How do I pass the object as a parameter?  In the parameters tab, I can do "Insert Parameter -> Object Reference", but then the parameter doesn't let me specify the .NET object.  It just has Value set to "Nothing" (which cannot be changed).
 
0 Kudos
Message 5 of 6
(3,607 Views)
OK, I figured this out.  In the subsequence I need to define a parameter (object reference), and then in the top level sequence I need to specify the reference to the .NET object as the parameter to pass to the subsequence.
 
0 Kudos
Message 6 of 6
(3,593 Views)