10-04-2018 06:18 PM
Hi,
I found a python script online that allows me to call a teststand sequence. The sequence is very simple, I am basically monitoring a voltage for hours at a time. The sequence will open and take one voltage measurement, but I am running into an error regarding the releasesequencefileex() function.
import win32com.client tsEngine = win32com.client.Dispatch('TestStand.Engine.1') print('TestStand %s.%s ready' % (tsEngine.MajorVersion, tsEngine.MinorVersion)) sequencePath = 'C:\\My Directory\\My Sequence.seq' seqFile = tsEngine.GetSequenceFileEx(sequencePath) execution = tsEngine.NewExecution(seqFile, "MainSequence", None, False, 0) execution.WaitForEndEx(60000) print(execution.ResultStatus) tsEngine.ReleaseSequenceFileEx(seqFile, 0x4)
The error I am getting is shown below.
Any help would be greatly appreciated.
Thanks,
Aaron
10-05-2018 04:21 PM
Hi Aaron,
What process model are you using?
This article might be helpful: http://digital.ni.com/public.nsf/allkb/21157F2B22A0FE1C86256E52007C0BED?OpenDocument
Best,
Misbah
10-05-2018 05:17 PM
Does this line return true or false?
@aaron660execution.WaitForEndEx(60000)
10-08-2018 10:22 AM
I am not sure what the process model refers to. I am running TestStand 2016 and Python 3.7.
10-10-2018 02:17 PM - edited 10-10-2018 02:17 PM
It does not appear to return anything in the python.exe window.
10-26-2018 03:20 AM
@aaron660 wrote:
execution.WaitForEndEx(60000) print(execution.ResultStatus) tsEngine.ReleaseSequenceFileEx(seqFile, 0x4)The error I am getting is shown below.
![]()
The WaitForEndEx(60000) will cause the Python program to wait only one minute for the sequence to finish executing before it then gets the ResultStatus and tries to release the sequence. Unsurprisingly this will fail if, as you're expecting the sequence is still running after one minute.
One fairly straightforward alternative could be to poll for UIMessages to look for the end execution message.