NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing strong type c# object to teststand

I am fairly new in teststand and this question that I have is critical part of the project that I am working on.

First, I am using C#.NET in VS2008 and NiTestand 4.2.

 

What I am trying to do, passing custom object from C#.NET to the sequence.

 

here is my code from c#:

 

        private void axApplicationMgr_DisplaySequenceFile(object sender, NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_DisplaySequenceFileEvent e)

        {

 

 

            SequenceFile sf = e.file;

 

            PropertyObjectFile pof = sf.AsPropertyObjectFile();

 

            PropertyObject po = pof.AsPropertyObject();

 

            po.NewSubProperty("Locals.Test", NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_Reference, false, "", 0);

 

//setting up of test station

TestStation ts         = new TestStation();

 ts.Name = "sample1";

 

 

   po.SetValInterface("Locals.Test", 0, ts);

            

            

            axSequenceFileViewMgr.SequenceFile = sf;

            

            //learn passing data object to sequence

        } 

 

 

Inside sequence I want it to display the ts.Name, so I am sure that the value of the object is still intact.

And also, what do you suggest the handling of error of this object? what event in TestStand API.

 

 

 

Attached is the sequence and the .net object

 

Thanks in advance for your help. 

 

 

0 Kudos
Message 1 of 3
(3,930 Views)

Can anyone answer this please?

Or does NI Teststand  has book for .NET developing?

There isn't much guidance avaialble online.

 

Thanks.

 

0 Kudos
Message 2 of 3
(3,906 Views)

Hi mdba,

It looks like you're using TestStand to call a DLL that calls into the TestStand API.  If that's your objective, you can just achieve that much more simply with a Statement step in TestStand.  

 

What is the TestStation class?  Is that one that you created yourself? 

 

What is your overall goal of this DLL?  It looks like you are trying to store the Station ID in a local variable.  If so, TestStand tracks this on its own and you can access it with the StationOptions.StationID property.  

 


Mark E.
National Instruments

0 Kudos
Message 3 of 3
(3,889 Views)