From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Teststand and Python:How to creat a sequencecontext obj

1,My code: <>import win32com.client <>import os <>cwd = os.getcwd() <>tsEngine = win32com.client.Dispatch("TestStand.Engine.1") <>print "TestStand %s.%s ready" % (tsEngine.MajorVersion, tsEngine.MinorVersion) <>sequencePath = os.path.join(cwd, 'MySequence.seq') <>seqFile = tsEngine.GetSequenceFileEx(sequencePath) <>tsPO = tsEngine.NewPropertyObject <>tsSequenceContext = tsEngine.NewEditContext(tsPO) 2,the code run then print error below: <>TypeError: The Python instance can not be converted to a COM object 3,I look up help file: <>NewEditContext Method <>Syntax <>--Engine.NewEditContext ( obj, [editArgsParam], [locationString]) <>Return Value <>--SequenceContext <>obj As PropertyObject <>[In] Specifies the object to initialize the sequence context. You can pass a sequence file, sequence, step, variable, or array of object references to steps. This method sets the sequence context properties that correspond to the object you pass. 4,I pass the PropertyObject type(tsPO) as an obj,but why it prompt"TypeError: The Python instance can not be converted to a COM object ". What is the correct "obj" type?Pls help.
0 Kudos
Message 1 of 1
(4,216 Views)