NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Goto Location Feature in the sequence analyzer

Solved!
Go to solution

I want to mimic the Goto Location Feature in the sequence analyzer.

Anyone know which API should I use?

 

I'm creating a sequence to be used under the Tools menu in the Sequence Editor.

I know how to get the sequence and step as reference.

But I don't know how to make Sequence Editor show the sequence/step I want.

 

Please help.

 

George Zou
0 Kudos
Message 1 of 14
(319 Views)

Look at Location object and Locations collection in TestStand Help

 

The properties of a Location object contain enough information for a user interface to find a specific piece of data the user interface displays.

Locations is a collection of Location objects. Use Locations to instruct the user interface to update the selection. Follow these steps to set the selection in a user interface:

Call the Engine.NewLocations method to create a Locations object.
Call the Locations.AddFileLocation, Locations.AddExecutionLocation, or Locations.AddTypeLocation method on a Locations object to specify data for the user interface to select.
Call the Locations.GotoLocation method on the Locations object to send the Locations object to the user interface.
The user interface receives the Locations object through the UIMessage.ActiveXData property of a UIMsg_GotoLocation UIMessage.
If the user interface supports the Goto location action, it updates the selection to correspond to the Locations object.
Message 2 of 14
(282 Views)

Thanks.

 

What is the syntax of the lookup string for the AddFileLocation?

 

George Zou
0 Kudos
Message 3 of 14
(260 Views)

Looking at the help for Locations.AddFileLocation it says:

This method specifies the lookupString parameter relative to the root of the PropertyObjectFile object. For example, if the location is underneath the PropertyObjectFile.Data element, the lookup string must use the Data. prefix.

So to access the first step in MainSequence you could open the file in the Sequence Editor and look at the Variables pane and navigate to:
    RunState.SequenceFile.Data.Seq["MainSequence"].Main["My Action Step"]

 

The AddFileLocation lookupString parameter would be:

    Data.Seq["MainSequence"].Main["My Action Step"]

or 

    Data.Seq["MainSequence"].Main[0]

Scott Richardson
https://testeract.com
Message 4 of 14
(241 Views)

Thanks for reply.

I got error -17306, Unknow variable or property name '["Initial Test"]'. in Goto Location.vi ... when I tried to use lookup string format: Data.Seq["Initial Test"].Main["Step 1 PowerOn"].

I did this in a popup VI with a Sequence Context passed in from TestStand.

Here is the diagram:

zou_0-1733157777005.png

 

 

George Zou
0 Kudos
Message 5 of 14
(215 Views)

If a lookup string includes quotes, then the quotes should be escaped.

Try: Data.Seq[\"Initial Test\"].Main[\"Step 1 PowerOn\"]

0 Kudos
Message 6 of 14
(211 Views)

Thanks for reply.

I'm still getting the same error with Data.Seq[\"Initial Test\"].Main[\"Step 1 PowerOn\"]

error -17306, Unknow variable or property name '[\"Initial Test\"]'. in Goto Location.vi ...

 

It even give me the same error for the MainSequence:

Unknow variable or property name '[\"MainSequence\"]'.

 

 

George Zou
0 Kudos
Message 7 of 14
(207 Views)

I am using GotoLocation in a TestStand Statement step and it work as intended.  Can you show a screenshot of the lookupString parameter of your VI?

0 Kudos
Message 8 of 14
(205 Views)
Solution
Accepted by zou

@zou wrote:

It even give me the same error for the MainSequence:

Unknow variable or property name '[\"MainSequence\"]'.

 

 


I was able to reproduce the error if I removed MainSequence from the file.  Can you put a breakpoint in your VI and inspect the SequenceFile object?  I would suspect that the SequenceContext or SequenceFile is not the same object that you intended to operate against.

Message 9 of 14
(199 Views)

image.png

George Zou
0 Kudos
Message 10 of 14
(197 Views)