NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

new python call teststand engine

I re-write my issue in new message.Thanks very much for altenbach's remindding.


I use python and teststand engine to customize solution.But I have some questions about it.
1,code as below:

tsEngine = win32com.client.Dispatch("TestStand.Engine.1") 
print "TestStand %s.%s ready" % (tsEngine.MajorVersion, tsEngine.MinorVersion) 
tsEngine.UIMessagePollingEnabled = True 
sequencePath = os.path.join(cwd, 'MySequence.seq') 
seqFile = tsEngine.GetSequenceFileEx(sequencePath) 
execution = tsEngine.NewExecution(seqFile, "MainSequence", seqFile, False, 0) 
execution.WaitForEndEx(60000) 
execution = None 
released = tsEngine.ReleaseSequenceFileEx(seqFile, 0x4) 
seqFile = None 
tsEngine.ShutDown(True) 
tsEngine = None ## Execution freezes here 



2,I need to use UImessage to get pass/fail result of "MySequence.seq".
So the first step,I set "tsEngine.UIMessagePollingEnabled = True".
But python print these error:

Traceback (most recent call last): File "D:\TS_solution\CallTestStand.py", 
line 39, in released = tsEngine.ReleaseSequenceFileEx(seqFile, 0x4) File "", 
line 3, in ReleaseSequenceFileEx pywintypes.com_error: (-2147352567, '\xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3', (0, u'TSAPI', u"Unable to unload sequence file 'MySequence.seq' because it is in use, possibly because it is executing.", None, 0, -17213), None)


3,I comment "tsEngine.UIMessagePollingEnabled = True",
then teststand pop-up warning windows,show as below:

References to PropertyObjects were not released properly. 
Total number of objects: 53 
Number of top-level objects: 13 
Note: Some top-level objects may be included if they are referenced by an incorrectly released top-level object. 
For example, an unreleased SequenceContext object references a SequenceFile object. 
The following top-level objects were not released: 
Executions [1 object(s) not released] 
Type Definitions [2 object(s) not released] 
Type Definition 
#1: Name: CommonResults Type Definition 
#2: Name: Error PropertyObjects 
[6 object(s) not released] PropertyObject 
#1: Type: ActiveX Reference Value: Nothing PropertyObject 
#2: Type: ActiveX Reference Value: Nothing PropertyObject 
#3: Type: Obj PropertyObject 
#4: Type: Array of Containers PropertyObject 
#5: Type: Array of Containers PropertyObject 
#6: Type: Array of Containers And the following uncategorized objects: 
UIMessage (TEMessage) 
UIMessage (TEMessage) 
Report 
EditArgs

4,How can I call Teststand API--UImessage class through Python?

0 Kudos
Message 1 of 1
(4,616 Views)