NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I programattically read whether or not a sequence file has been opened?

I need to programattically determine through the IEngine interface whether or not a sequence file has been loaded. I don't see a "IsSequenceFileLoaded" property, I don't even see a way to read the file path of the currently loaded sequence file. I've tried querying for the sequence file interface.

SequenceFile tsCurrentFile;
CString csCurrentPath;
tsCurrentFile = (LPDISPATCH)m_tsEngine;
csCurrentPath = tsCurrentFile.GetPath();

But that hangs. Any clues?

Aaron
0 Kudos
Message 1 of 2
(3,222 Views)
Hello Aaron

As far as I know, there is no method/property to get the current sequence file. In fact, in the code you sent it seems that you are trying to typecast an Engine Object into a sequence file object. I believe this will not work.

There are a couple of ways to know if a sequence file is already loaded or not. You mention you have the Engine object so I assumed you are in the operator interface. In the OI, you are pretty much in the control of everything and the user will not be able to open a file if you don't call the Engine.GetSequenceFile Method. The idea is to modify your code to store the current sequence file name in a global variable or even store a reference to this sequence file object when you call the method above.

Then, anytime y
ou need to check if a sequence is loaded, you simply read this variable.

On the other hand when you call the Engine.ReleaseSequenceFile method you clear the global variable.

Roberto Piacentini
National Instruments
Applications Engineer
www.ni.com/support
0 Kudos
Message 2 of 2
(3,222 Views)