NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

open sequence method anywhere?

Hello,
I'm making a edit substep using labview for a step type, which will open a teststand sequence in the editor.  There already is an item "open sequence", but this particular step type executes a sequence by expression at runtime, so we can't open at edit time using the "open sequence" item.  The substep will prompt the user for the necessary information to find the right sequence, but then I want to call a method to open the sequence in teststand, in the same way as "open sequence" works when you right click on a sequence call. 
I have browsed the methods/properties for "sequence context/engine", and I see an "open workspace file" item, but we are not using workspaces (which is a completely different post).
So can anyone tell me where there might exist an "open sequence" method with which I can open a teststand sequence in the editor?

Thanks
David Jenkinson
0 Kudos
Message 1 of 6
(3,748 Views)
Hey David,
 
I'm not sure this is possible unless you have a custom seq. editor or you do it in the UI.  That is if I understand you correctly.  Basically you want to dynamically load a sequence file into the seq. editor?  Is that correct?  If so you can load it into memory just not have it show in the seq. editor. 
 

GetSequenceFileEx Method

Syntax

Engine.GetSequenceFileEx ( sequenceFilePath, getSeqFileFlags = GetSeqFile_OperatorInterfaceFlags, handlerType = ConflictHandler_Error)

Return Value

SequenceFile

A SequenceFile object.

Purpose

Returns the SequenceFile object for the sequence file specified by the sequenceFilePath parameter.

Remarks

Loads the sequence file from disk, if necessary. Call ReleaseSequenceFileEx on this object before releasing it.

This method loads the sequence file into the engine's internal cache and adds a load reference to the sequence file. TestStand uses the load reference count to determine when to unload the sequence file from the engine's internal cache. In addition to this method, the SequenceFile.AddLoadReference and Engine.NewSequenceFile methods also add a load reference to the sequence file. The Engine.ReleaseSequenceFileEx method removes a load reference.

You must call Engine.ReleaseSequenceFileEx for each load reference that you add to the sequence file. When you release the last load reference, TestStand unloads the file from the engine's internal cache. While unloading the file from the cache, TestStand executes the SequenceFileUnload callback, if applicable.

You can use SequenceAdapter.GetSequenceFile to examine the contents of a sequence file without running load and unload callbacks, without preloading modules, and without merging types.

Hope that helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(3,729 Views)
You need to post a UI message with the UIMsg_OpenWindows event.  You can specify in the string parameter for the path to the file you wish to open.

To pass a UI message, you can use the API:

Thread.PostUIMessageEx(UIMsg_OpenWindows, 0, <path>, Nothing, true).

Allen P.
NI
0 Kudos
Message 3 of 6
(3,716 Views)
Hi Allen,
I tried your suggestion, it did not work.  I think it is perhaps because I am not actually running a sequence at edit time, which is why the thread property returns null.  The vi that is executing is the module of an edit substep of the step type.  What the substep does is prompt the user to enter some information, then should open the proper sequence based on that information (builds a directory/file path).  I have attached the code and error I see, with probes.
Do you know of another way to do this, or to get this way to work in the context in which it is being used?  Is there a way hidden in the TS engine properties/methods somewhere?
Thanks
David J
0 Kudos
Message 4 of 6
(3,680 Views)
David,

You can use the Engine.PostUIMessage method instead and post NULL for the thread and execution parameters.  You can get the Engine from the Sequence Context with a property node.

Allen P.
NI
0 Kudos
Message 5 of 6
(3,675 Views)
Allen,
This worked perfectly,  Thanks!
0 Kudos
Message 6 of 6
(3,669 Views)