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: 

How to programmatically read the SequenceFile currently open (front most) ?

Solved!
Go to solution

I have open in TS few sequences, they can be sequences or subsequences, but the one is currently open in TS. I would like to know from the ActiveX libs the one sequence file that is front most in teststand. I know I can enumerate on all open sequence files but I don't know how they are sorted and how to get the one that is open front most.

 

The reason for that is i want to run from the TS custom menu my own sequence that will do some action on the sequence currently open in TS. 

 

I attached my example VI to get the Sequence references of all open sequences in TS.  

 

Thx in adv... 

0 Kudos
Message 1 of 13
(5,663 Views)

Check out RunState.InitialSelection in the TestStand Help. You can use expresssions like,

 

NameOf(RunState.InitialSelection.SelectedSteps["Label"])

NameOf(RunState.InitialSelection.SelectedSequences[0])

 

RunState.InitialSelection.SelectedFile

 

Experiment with it. The 

cc

0 Kudos
Message 2 of 13
(5,654 Views)

As I understand from the TS manual, these functions corespond to the running sequence only, but my sequence is not running, it is only open. 

0 Kudos
Message 3 of 13
(5,649 Views)

Help says the following about the InitialSelection property.

 

Contains references to properties, steps, sequences, sequence files, and executions that are selected or active when you start an execution. If the active window is a Sequence File window, the InitialSelection property contains non-execution versions of the selected objects. If the active window is an Execution window, the InitialSelection property contains execution versions of the selected steps, properties, and sequences as well as non-execution versions of the selected sequence file.

 

Are you going to run a sequence called from your Tools menu?  If that is the case you should be able to use the RunState.InitialSelection.SelectedFile properties.

 

I have done the following from a tools menu sequence to obtain a sequence.

 

If    ( PropertyExists("RunState.InitialSelection.SelectedFile.Path"))

    {

         IF ( RunState.InitialSelection.SelectedFile.Path == "" || RunState.InitialSelection.SelectedFile.Path == RunState.SequenceFile.Path )

               /*Checks if there is a valid file open or you are just running the sequence in the Tools menu */         

 

                   Display File Dialog  to locate Sequence File.

     }

 

     Else  Locals.Path = RunState.InitialSelection.SelectedFile.Path

 

 

Plus what did you mean by 'front-most' sequence file?

 

Thanks,

PH

 

0 Kudos
Message 4 of 13
(5,640 Views)

I'm not going to run the sequence file. I have a TS open with few sequences open already. I start my application from the TS menu and would like to read some data from only the one visible sequence (front most). Attached there is an image showing 3 sequences open in TS. "Sequence file 4" is front most (visible) to the user. The other 2 are hidden behind.

0 Kudos
Message 5 of 13
(5,637 Views)

I don't understand what you mean by, "I start my application from the TS menu." If you start your app from the Tools Menu, or another seq, Initial Selection will work. If you are using an app external to TestStand, and you want to use the TestStand api, not sure about that. You could try the AEs.

cc

0 Kudos
Message 6 of 13
(5,635 Views)

How to get the reference to the RunState object in LV? How to pass this referece of RunState from TS to LV?

 

I have created the custom menu from where I run my application, then i want to manually control what is open in TS, e.g. close all open sequences, open selected sequences, put one front most (activate it for user), then for the one activated make some action. Is this possible?

0 Kudos
Message 7 of 13
(5,630 Views)

Is this on an operator interface? "I have created the custom menu from where I run my application..." Normally you would be able to add things to the Configure menu or the Tools Menu, and I'm not familiar with any other menu customizations. There may be a better way to achieve your goals by using the TestStand components. MAybe you could explain it a little more at a higher level.

cc

0 Kudos
Message 8 of 13
(5,623 Views)

Dear maszup,

 

I read your forum post, and I think I got it what you want to do.

I didn't try to do the same, but I think if you have already a SequenceContext reference in your VI then you are able to get the selected file which was front most at the beginning of the execution.

Use a Property Node with "SelectedFile" which gives you a TS.SequenceFile reference.

 

SelectedSequenceFile.png

 

(Remark: When you don't use anymore that reference, close it.)

 

Please try it out, and hopefully it works 😉

 

Best Regards,

Tamas Szekely

 

0 Kudos
Message 9 of 13
(5,574 Views)

I used SequenceFiles (attached picture) to get all open sequence files from TS. 

 

I will check the SelectedFile property in the meantime. 

 

Thanks for your help 

0 Kudos
Message 10 of 13
(5,556 Views)