03-12-2010 03:50 PM
An Adapter is the name of the feature in TestStand that allows calling into code modules of various types. For example, the LabVIEW Adapter is what you use to call labview VIs from a TestStand sequence. There is also a .NET adapter, an ActiveX adapter, a CVI adapter, a DLL adapter, an htbasic adapter, and a <none> adapter.
Module prototype not being compatible is an error message from the adapter which indicates that the adapter has detected that the code module has a different prototype than the one specified for the step. This usually happens when the prototype is changed after having specified the step.
IsPrototypeIncompatible returns true if the prototype is different than the one found in the code module, however it returns false, not only when the prototype is compatible, but also if the code module can't be loaded and in some cases if no such member exists in the code module. Thus a false value does not necessarily indicate that the module is loadable or runnable. Also, the exact result depends on the adapter.
You can run the analyzing sequence using the Engine.NewExecution method. You will likely want to use the execution type mask options: ExecTypeMask_InitiallyHidden | ExecTypeMask_TracingInitiallyOff
in order to make the execution hidden. Also, you will need to set the EditArgs to the sequence file you want it to analyze. See the online help for more information about this and related APIs.
Hope this helps,
-Doug
03-15-2010 01:03 PM
Re: adapter, that's what I thought. I am using .NET adapter. With that, do you think isPrototypeIncompatible will not work as part of verification? Because I never changed anything from my dll, I just recompiled it and when I tried verifying it using the Tools | Analyze Sequence File, it is throwing me error message that it is not compatible.
I tried running the NewExecution programmatically but it seem not picking up the parameter, or maybe I am doing something wrong.
Below is my code:
Engine engine = axApplicationMgr.GetEngine();
SequenceFile sf = engine.GetSequenceFile(@"D:\National Instruments\Tools\Analyze Sequence File 4_2_1.seq", 0);
Sequence se = sf.GetSequenceByName("Analyze Sequence File");
PropertyObject po = se.AsPropertyObject();
po.SetValVariant("Parameters.SequenceFile",0,currentSequenceFile); //currentSequenceFile is the file that I am going to verify and check
Execution exec = engine.NewExecution(sf, "Analyze Sequence File", null, false, ExecutionTypeMask.ExecTypeMask_InitiallyHidden | ExecutionTypeMask.ExecTypeMask_TracingInitiallyOff, po, null, null);
Thanks again!
03-18-2010 01:22 PM
If IsPrototypeIncompatible returns true then the prototype is definitely out of date, but if it returns false, that doesn't mean there isn't some other problem. All I was saying is that it won't catch everything, only some things. You might want to add additional code to catch other things.
Your new execution code is incorrect. You are not passing the parameter correctly, are not cleaning up from opening the sequence file correctly, and a few other minor issues. See the example code below (note: I might have made some typos, I didn't actually try to compile this):
PropertyObject sequenceArgs = engine.NewPropertyObject(PropertyValueTypes.PropValType_Container, false, "", 0);
sequenceArgs.SetPropertyObject("SequenceFileParameter", PropertyOptions.PropOption_InsertIfMissing | PropOption_NotOwning, currentSequenceFile.AsPropertyObject());
Execution exec = engine.NewExecution(sf, "Analyze Sequence File", null, false, ExecutionTypeMask.ExecTypeMask_InitiallyHidden | ExecutionTypeMask.ExecTypeMask_TracingInitiallyOff, sequenceArgs, System.Type.Missing, System.Type.Missing);
engine.ReleaseSequenceFileEx(sf, 0); // You need to call ReleaseSequenceFileEx for each call to GetSequenceFile
Hope this helps,
-Doug
11-30-2010 09:42 AM
Consider upgrading to TestStand 2010 which comes with a Sequence Analyzer that helps you find problems, such as parameter incompatibilities, in sequences before you execute them.