08-04-2009 05:07 PM
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.
08-06-2009 12:08 PM
Can anyone answer this please?
Or does NI Teststand has book for .NET developing?
There isn't much guidance avaialble online.
Thanks.
08-06-2009 04:13 PM
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.