NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

[OperatorInterface in C#]How to prevent the previously opened test sequence file will be opened

Solved!
Go to solution

I am implementing operator interface in C# based on Teststand sample.

 

In MainForm_Load(), I use [axApplicationMgr.OpenSequenceFile(mySeqFile);] to open sequence file.

However, I registered event handler for axApplicationMgr.SequenceFileOpened event and found the event handler was called twice.

The first time is mySeqFile and the second time is the previously opened test sequence file.

 

I tried to call CloseAllSequenceFiles() before closing the application but the problem remains.

 

Could anyone please tell me the reason and how to resolve it?

 

0 Kudos
Message 1 of 5
(1,227 Views)

Hello zhpy,

 

just a wild guess, but is there any chance mySeqFile refers to your previously opened sequence file?
e.g. mySeqFall makes sequence calls to sequences of the other file?

So the other sequence file will implicitly be loaded as part of the sources of mySeqFile.

Stefan

Message 2 of 5
(1,204 Views)
Solution
Accepted by topic author zhpy

Sounds like you might want to look at ApplicationMgr.ReloadSequenceFilesOnStart

Message 3 of 5
(1,198 Views)

Thanks for your reply, Stefan.

I tried to open different files.

0 Kudos
Message 4 of 5
(1,189 Views)

Thank you, James.

I set ReloadSequenceFilesOnStart to ReloadFiles.ReloadFile_None before axApplicationMgr.Start();

Then the problem was resolved!

Thanks so much!

0 Kudos
Message 5 of 5
(1,187 Views)