NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

NewExecution crashes with -17332

I'm still very green on the use of the TestStand Engine API, but I'm starting to think I am missing some crucial understanding of how this is all tied together and the flow of events and processes and threads.
 
Anyway, I have the Full-Featured Visual C++ code that I have been modifying.  From an external stimulus (NOT the user interface) I am told to run a sequenceusing the sequential model (Single Pass).  I call or perform the following:
 
Engine->FindFile to verify the sequence exists before continuing.
Engine->GetSequenceFileEx to obtain a SequenceFilePtr
Engine->GetStationModelSequenceFile to obtain a SequenceFilePtr for the station model sequence
Create a _variant_t sequence arguments object from a sequence arguments property object passed in
Finally call Engine->NewExecution for the sequence
Engine->ReleaseSequenceFileEx for both the sequence and station model sequence ptrs
 
The sequence executes, but gets to a point where it sends a UI message and then waits on a notification.
The UI message is handled by the OI, which eventually results in another external stimulus to run a "wakeup" sequence which will send a notification to allow the first sequence to continue.  This second sequence executes the same path of code as described above, except it doesn't get the station model sequence.  When the NewExecution is called for this "wakeup" sequence, then I get the OI crashing with a runtime error.  If I capture the exception, it's a -17332 (TS_Err_ObjectTypeIncompatibleWithParameter).  I can not find any other help (in TestStand or on the web) about the cause of this type of error.  I have verified all the parameters are valid, but my guess is that something about having multiple new executions going simultaneously is giving the engine fits sometimes.
 
Note that I do not always get this error, but generally most of the time.  I am sure I am violating some set of "rules" about how to call these functions, with the wrong parameters in the wrong order, but it's hard to determine what is right always.  The HELP is excellent, but like most things, you have to know what you are looking for before you can find it.
 
Thanks for any thoughts from the community.
 
Attached is the a file with the method that executes the above functions if it's of any interest.
 
0 Kudos
Message 1 of 3
(2,945 Views)
In case anyone is interested, my problem documented in this posting has to do with calling NewExecution with a process model entry point ("Single Pass").  I still don't know my solution, but I think I am closer.  I believe the -17332 error is occurring because I am calling to execute my sequence ("dostuff.seq") using the process model entry point.  The Single Pass entry point takes a single string parameter (which defaults to "MainSequence"), but the sequence arg parameter I pass to NewExecution has a number value parameter (which is what my dostuff.seq is expecting).
Of course this begs the question -- how do I pass arguments for my dostuff.seq to NewExecution when executing an entry point which is expecting a different argument?
 
I have spent way too much time on this -- does anyone out there have any thoughts or comments on this?
0 Kudos
Message 2 of 3
(2,927 Views)
Hi,
 
By default MainSequence doesn't use Parameters, Therefore you would have to modify your process model entry point sequences if you want to pass parameters to the MainSequence.
Have you tried setting up an InteractiveArgs and calling a Sequence not called MainSequence?
(similar to running a "Selected step with using Single Pass" menu item.)
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 3 of 3
(2,912 Views)