NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect if a subsequence exists in an external sequence file?

Solved!
Go to solution

In Foo.seq there are n subsequences. How can I check if the file contains subsequence called "Bar"?

 

Note that Foo.seq will be loaded dynamically during execution.

0 Kudos
Message 1 of 3
(2,929 Views)
Solution
Accepted by topic author Heartbeat

There is a method called SequenceNameExists() that you can use.

 

you need to get a reference to the sequencefile. If it is not loaded use Engine.GetSequenceFileEx() to load it. Then use the returned reference to check if the sequence exists. Check out the Sequencefile methods.

 

dont forget to release the sequencefile when you are done.

Regards
Ray Farmer
Message 2 of 3
(2,862 Views)

Thanks. It seems to me that RunState.Engine.GetSequenceFile("foo.seq").SequenceNameExists("Bar")) is better since it does the load and unload automatically.

 

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

 

One more question as I'm new to the TestStand API. Lets say that I run Locals.ref = RunState.Engine.GetSequenceFileEx("foo.seq"). How can I then call the refs methods?

 

Locals.ref.SequenceNameExists("Bar") <-- generates error. I used Object reference as I don't see any SequenceFile type in the Type Palette.

 

0 Kudos
Message 3 of 3
(2,850 Views)