04-20-2001 07:12 AM
04-20-2001 04:57 PM
02-07-2007 06:03 AM
02-08-2007 03:30 PM
02-08-2007 05:22 PM
Hi James
Thanks for the reply.
I am trying to modify the OI code with CVI under:
C:\Program Files\National Instruments\TestStand 3.5\OperatorInterfaces\NI\TestStand 2.0.1 Operator Interfaces (Old)\Full-Featured\CVI
There is a CVI project called: testexec.prj. This has an engine.c file, and a function called:
TERetval Eng_BeginSeqExecution. Within this function, there is a TS_EngineNewExecution function call, and I am trying to pass parameters to the sequence using the arguments to the TS_EngineNewExecution call (in place of the CA_DEFAULT_VAL). How do I pass a parameter in place of this CA_DEFAULT_VAL?
The example shows passing the editArgs parameter, while the seqArgs and the interactiveArgs are default.
Thanks
02-08-2007 05:36 PM
axApplicationMgr1.Start();
mEngine=axApplicationMgr1.GetEngine();
CurrentSequenceFile=axApplicationMgr1.OpenSequenceFile("Sample.seq");
NationalInstruments.TestStand.Interop.API.PropertyObject pobj=mEngine.NewPropertyObject(NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_Container,false,"",0);
pobj.NewSubProperty("param1",NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_String,false,"",0);
pobj.SetValString("param1",0,"This is a new message");
mEngine.NewExecution(CurrentSequenceFile,"MainSequence",null,false,0,pobj,null,null);
And it works fine. How do I do the same thing in CVI?
Thanks
02-09-2007 11:23 AM
02-09-2007 12:11 PM
Hi James,
Thanks for the reply.
I got it working with C#, but am not able to do it with CVI. Apparently, a property will not do it, I need to create a subproperty.
This is not the entire code, just a snippet.
Also, I get some warning that the handles to some of the variables I created (the seqArgsVar) have not been released. I guess in CVI, the CA_DiscardObjHandle discards the handles to the objects created. What is the equivalent in C#?
Thanks
try
{
axApplicationMgr1.Start();
mEngine=axApplicationMgr1.GetEngine();
CurrentSequenceFile=axApplicationMgr1.OpenSequenceFile("Sample.seq");
NationalInstruments.TestStand.Interop.API.PropertyObject pobj=mEngine.NewPropertyObject(NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_Container,
false,"",0);pobj.NewSubProperty("param1",NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_String,
false,"",0);pobj.SetValString("param1",0,"This is a new message");
mEngine.NewExecution(CurrentSequenceFile,"MainSequence",
null,false,0,pobj,null,null); } catch(Exception e){
MessageBox.Show(e.Message,"TestStand Error");
}
finally{
mEngine.ReleaseSequenceFile(CurrentSequenceFile);
axApplicationMgr1.CloseSequenceFile(CurrentSequenceFile);
mEngine.ShutDown(
true);axApplicationMgr1.Shutdown();
}
02-12-2007 01:20 PM
02-12-2007 08:16 PM
Hi James
Thanks for the reply. I am writing with CVI.
Thanks