NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with 'CloseAllSequenceFiles' and 'OpenSequenceFile'

Steve,

Are you running any executions when this is happening?  That is the only way I can reproduce the problem you are seeing.

An easier way to solve this problem may be to remove the configuration entry point from the picture.  Since the configuration entry point is just posting UI messages (and are not handled by the Sequence Editor anyway), it might be best to just add a normal menu item and handle it entirely in your OI.  You would disable this menu item if any executions are running, so that you would not run into this problem.  Or you could close all executions before trying to close any open sequence file.

Allen P.

TestStand R&D

0 Kudos
Message 11 of 18
(1,623 Views)

Allen:

The only execution is the configuration entry execution. So, I guess, the answer is yes. Allen this discussion actually spans numerous service request numbers. We are trying to upgrade from TestStand 2.0.1f1 to 3.1. We have decided to use your RTOI pretty much right out of the box.

We have a configuration entry point that allows users to select test solutions to run from a configuration management database. The "TPS Load" configuration entry point does much more that the sequence your looking at. The one I gave you is a way to simplify the problem we are seeing. The actual "TPS Load" downloads files from a server and configures TestStand to run a downloaded sequence file.

Everything works just fine until a sequence file with the same name (that is different) is downloaded to the working directory.

We had this situation addressed in 2.0.1f1 but, there were no activeX controls at that time. I suspect this has someting to do with some property/method we need to figure out.

I've talked with numerous NI support personnel over several service request numbers without much luck.

 

Like I said from the beginning "Simple Code - Difficult TestStand Question" 

 

Steve

 

 

0 Kudos
Message 12 of 18
(1,628 Views)

I was unable to reproduce the problem.  However, if the errors occur only when the RTOI prompts to reload the file from disk, consider disabling this feature by setting the ApplicationMgr ReloadModifiedFilesInterval property to 0.

0 Kudos
Message 13 of 18
(1,606 Views)

Steve,

I also was unable to reproduce this problem UNLESS I was running an execution of the sequence file that was open in the Sequence File List that was executing (because I spawned off an execution in the OI).

So we must be doing something different.  Currently, I am using the latest model you posted (changing a few local variables), along with the following OI code:

 

switch

(e.uiMsg.Event)

{

case (UIMessageCodes) 10000: // TPS Load

// axApplicationMgr.CloseAllSequenceFiles();

axApplicationMgr.OpenSequenceFile(e.uiMsg.StringData);

break;

case (UIMessageCodes) 10001: // Close All Sequence Files

axApplicationMgr.CloseAllSequenceFiles();

break;

}

I'd like to take a closer look at the problem, but so far I have been unable to reproduce it.

 

Allen P.

NI

0 Kudos
Message 14 of 18
(1,602 Views)

I'm actually using the UI code that Adam gave me:

 

switch(e.uiMsg.Event)

{

case(UIMessageCodes)(10000):

Engine engReference = axApplicationMgr.GetEngine();

int count = axApplicationMgr.SequenceFiles.Count;

for (int i = 0; i < count; i++)

{

engReference.ReleaseSequenceFileEx(axApplicationMgr.SequenceFiles[i], 0);

}

axApplicationMgr.CloseAllSequenceFiles();

break;

case(UIMessageCodes)(10001):

axApplicationMgr.OpenSequenceFile(e.uiMsg.StringData);

break;

}

I'm going to be out of the office until 9/30
 
Thanks,
Steve
0 Kudos
Message 15 of 18
(1,593 Views)

This sounds like a good Idea.....

I'm going to be out of the office until 9/30 but, I'll try this when I return.
 
Thanks,
Steve
0 Kudos
Message 16 of 18
(1,593 Views)
Steve,

Remove the ReleaseSequenceFileEx calls.  The ApplicaitonMgr will call those functions for you, so you may be releasing them too many times.

If you are opening any sequence file references in your Configuration Entry point, you will need to call ReleaseSequenceFileEx on each reference.

Allen P.
NI
0 Kudos
Message 17 of 18
(1,590 Views)

I have finally figured out what was going on here. When you guys told me that you could replicate the problem and that the only time you saw this problem was when the sequence was actually executing I started to review all the events TestStand was processing. What I found out is that a lot happens when a sequence file is unloaded. In this sequence there was a engine callback (SequenceFileUnload) so the sequence file was executing while the system was replacing it causing this error. All I had to do was add a simple sleep call to allow the sequence file to run the engine callback and completely unload.

 

Thanks to everyone that help on this,

Steve

0 Kudos
Message 18 of 18
(1,562 Views)