NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Close open seq files / Reload all seq files

Hi All.

 

I have a problem with the OI. When I have started a seq and it fails because of a seq error... then I go to the editor and correct the fault, and then try again in the OI, but it doesn't reload the seq file after it is changed.

 

Then I try to put in a button on my OI to close the seq file.

 

I have tried to do this in 2 ways.

 

First I tried to use ApplicationMgr.ReloadModifiedSequenceFiles , but it does not work, I cant figure out why it isn't changed after I press save....

 

Then I tried to use ApplicationMgr.SequenceFiles and afterwards SequenceFiles.Count, but Count is always 0.... why....  it seems that all seq files are running in another instance of that activex server....

Count should at least be 1 because I have a seq file that is running in a "endless" loop in the background..

 

So any ideas ???

0 Kudos
Message 1 of 12
(3,820 Views)
What is the ApplicationMgr.ReloadModifiedFilesInterval set to?  If it is any positive number, it should poll sequences to see if they have been changed.  If it is 0, then it will only reload modified files if you call the method ApplicationMgr.ReloadModifiedSequenceFiles.  If you currently have an execution running with that sequence, you will be unable to reload the sequence file at that time.  Otherwise, it should prompt you that a sequence file has been modified and ask if you want to load it.  Also, my ApplicationMgr.Sequences.Count stays updated with the number of open Sequence Files in the OI.  Do you have multiple Application Manager controls?
 
Allen P.
NI
 
 
0 Kudos
Message 2 of 12
(3,800 Views)

Hi Allan.

I have just tried again... and I cant it to work.

My OI is just a slightly modified "Simple OI"

What I have done is that I have made a event that fires when I press a button. The only thing the event does is that it calls ReloadModifiedSequnceFiles. It seems that i cant see that the file is changed.

ApplicationMgr.SequenceFiles.Count still reports 0..

Maybe it could have something to do with the way I call the seq. I have this background seq that calls the test seq. This background seq is hidden, and that has caused med a lot troubles before... (as you properly know.. Anders Meister you know..)

I have checked that I only have one ApplicationMgr in the OI.....

Any other Ideas ??

Kind Regards Thomas

0 Kudos
Message 3 of 12
(3,793 Views)
ApplicationMgr.SequenceFiles will only list sequences that have been opened by the Application Manager.  These are the files that are listed in the first ComboBox control, if you are using the Simple OI.  ReloadModifiedSequenceFiles will only reload these files.
 
It sounds like the fact that the file you want updated is running in a hidden execution might be the culprit.  Can you confirm these details?
0 Kudos
Message 4 of 12
(3,790 Views)
Maybe I need to redefine "slightly modified Simple OI". I have changed a lot since I started out from the simple OI. .. sorry... couldn't remember all the work I have done.
 
 
The way the is working is that the OI starts up this background seq (hidden), this seq is controlling our inline test machines, so I wait on a barcode from a PLC, and when I receive this, then this seq is calling the testseq in a new execution (with a process model, unhided)......
 
So that is properly the problem.. the ApplicationMgr.. cant see that this test seq is loaded.....
 
So I have properly gone down a blind road... so back to the goal...
 
I need a way to unload my test seq that is loaded from my OI...... without disturbing my background seq.. I can properly unload it directly in the background seq, after it returns from the test... but I don't want to unload it every time (will take to long time).. so it should only be done when it is forced to do it from the OI.
0 Kudos
Message 5 of 12
(3,784 Views)
Are you holding on to these Sequence References that you open on your own?  I am assuming these are the sequences you are opening through the engine.  In that case, you will have to reload the files on your own when they have been modified.  You can check to see if a file has been modified by using PropertyObjectFile.IsDiskFileModified.
 
Hope
0 Kudos
Message 6 of 12
(3,759 Views)
Are you holding on to these Sequence References that you open on your own?  I am assuming these are the sequences you are opening through the engine.  In that case, you will have to reload the files on your own when they have been modified.  You can check to see if a file has been modified by using PropertyObjectFile.IsDiskFileModified.
 
Hope this helps!
 
Allen P.
NI

Message Edited by AllenP on 10-06-2005 10:18 AM

0 Kudos
Message 7 of 12
(3,762 Views)

Hi Allan.

I don't hold any reference do these files (as far as I know), I just launch my "test seq" from my background seq  (launched in a new execution, with the normal seqmodel), but it could be a good solution to check if the seq file has changed before I start the seq.. this could properly be done both from my background seq or in the model seq... I have not not laptop with me home today (I have been on a NI seminar today Smiley Happy ) but I will try this as the first thing tomorrow morning.

Thanks for your answer...

 

0 Kudos
Message 8 of 12
(3,752 Views)

Hi Allan.

Now I know what you mean about if I was holding a reference to the new execution. Now I have made this reference, and I can also get out the information if the seq is changed or not, but now I cant get ReleaseSequenceFileEx to work, it will not release and unload the file.

The problem must be that another "thing" has a reference to the seq. The only other thing I can think of is the Execution View in the OI.......

So now I am a little bit lost again... can you please help me a little bit further.

I have attached a cut of my background seq, so you can see what I am doing.

 

0 Kudos
Message 9 of 12
(3,736 Views)
You are incorrectly releasing the file because you did not get a reference with GetSequenceFileEx.  You can fix this problem by either calling SequenceFile.AddLoadReference() or call Engine.GetSequenceFileEx before you release the sequence.
 
Hope this helps!
 
Allen P.
NI
0 Kudos
Message 10 of 12
(3,717 Views)