NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to suppress warning about files changed outside teststand

I am doing the following:

  1. Updating values in the users file
  2. incrementing the change count of the file
  3. doing a "SaveFileIfModified" with prompt=false.
  4. Then doing a "ReloadFromDisk"

How come I keep getting the message:
"The file '...\Users.ini' has been modified outside of the sequence editor. Do you want to reload it?

What is the proper way to suppress this?

Using: LV7.1 + TS3.1


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 1 of 13
(5,760 Views)
Hey Michael,
 
Do you have two instances of the TS Engine open when you change the user file?  This is usually the case when this message occurs. 
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 13
(5,719 Views)
That's a good question. I don't think so. I am doing the coding in LV VI's which execute as steps in a sequence file. Within the VI's I'm carefull about passing the Engine reference around and close it at the end. What is the trigger that launches another TS Engine? I'm passing the "RunState.Engine" object into the VI's. I also tried using the "SequenceContext.Engine" but I assume it's the same thing. Should I be closing the Engine Object each time I access it? I also tried that but It didn't change a thing.

On the bright side, I'm having excellent success writing and updating the StationGlobals file. I never get a prompt. I'm using the "CommitGlobalsToDisk" which works flawlessly.


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 3 of 13
(5,713 Views)
Well, I managed to isolate the problem into a single VI inside a test sequence. I've attached the VI and the sequence. This should be reproducable on any computer but it was written in LV7.1 and TS3.1.

Any advice is appreaciated.


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 4 of 13
(5,693 Views)

Hey Michael,

That is almost exactly like the one we were using to reproduce the issue.  I had reproduced it yesterday and am in the process of talking to R&D about the issue.  I will post as soon as I come up with an explanation.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 13
(5,684 Views)
Well, the issue seems to go away if you skip the message pop-up step.


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 6 of 13
(5,672 Views)

Hey Michael,

First let me address your message popup.  I don't think that is working for you.  If you remove the message box and then run your sequence and then click outside of TestStand and then back into TestStand you will still get the warning.

I don't understand why you are calling the SaveFileIfModified method.  You can just call the IncChangeCount and be fine.  I tested it by adding a user from to TestStand and I didn't get the message.  And it added the new user.  So if you get rid of the SaveFileIfModified and ReloadFromDisk then you will be set.  I hope that helps.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 13
(5,669 Views)
No, I'm afraid this is not a solution either. The reason I call the SaveFileIfModified method is because I need to suppress the dialog that pops up when you exit TS. If you make any changes to the users.ini file, TS will prompt you to save your changes when you exit.


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 8 of 13
(5,625 Views)

Hey Michael,

It's good to finally hear from you. 

Unfortunately there isn't a way to turn off both of the warnings.  This is a vital part of TestStand.  If this did not pop up and give the user the option to accept or reject that the .ini file had been changed then you could run into race condition issues.  Say for instance you modify the .ini file and haven't accepted the changes and then someone else changes the .ini file as well.  You could run into issues.

I hope this helps.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 13
(5,621 Views)
An idea that occurred to me while skimming this thread was to get the disk file time, save the file, and then set disk file time back to what it was so that the file appears to be unmodified. I think I remember seeing a function for setting the file time in the Windows SDK. I'm not sure if this would be useful for your needs, but I wanted to mention it just in case.
0 Kudos
Message 10 of 13
(5,610 Views)