Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot Open State File For Writing

Hello, I am trying to use the method for "Opening A Process In A Known State" documented in the Lookout help file. I have saved my state file the way I want it, quit Lookout and made the state file "Read Only". I have also turned off the state file saving under "Modify Process". However, when I go to exit my process, Lookout complains that it "Cannot open state file for writing".

The cause is obvious (the file is read only), however I don't want the notification. I've done this in other processes before and haven't gotten the warning. How do I turn it off? Is there a way to make Lookout not try to save the state file upon exit?

Any help would be greatly appreciated!
0 Kudos
Message 1 of 12
(4,904 Views)
tritone,

I tried to reproduce the same issue on my system but did not get an error message when I closed the process. I even tried adding some pots after after making the state-file read-only and still had no problems closing the process.

What version of Lookout are you using? Does this happen with all processes or is it specific to a certain process? If you can post a simplified process that consistently reproduces this error I'll check it here.

Regards,
Nick F.
Applications Engineer
National Instruments
~~
0 Kudos
Message 2 of 12
(4,886 Views)
Hello, thanks for your reply. I am using Lookout v5.0. This warning only occurs on one specific process. I have used the "read-only" method before on other processes with Lookout 5.0 and have not had this warning. Unfortunately I don't have a stripped down version of the process, or access to Lookout right now (the process is running remotely). Any information you can provide would be greatly appreciated.
0 Kudos
Message 3 of 12
(4,878 Views)
tritone,

After investigating this matter futher I've discovered that Lookout 5.0 will always give you the error you mentioned. Functionally, Lookout is attempting to save the state of the process so it can be re-started, or continued by a back-up system.

Later versions of Lookout (5.1 on) function the same way, but do not show the file write error when the process is closed.

Unfortunately there is no way to force Lookout not to attempt to save the state file when you close a process.

Regards,

Nick F.
Applications Engineer
National Instruments
~~
0 Kudos
Message 4 of 12
(4,880 Views)
What if:

You saved the process the way you want it in one place and then allowed Lookout to go ahead and save the newer files in another place?

The caveat is that you will need to know where to go for the process file you really want the next time Lookout boots. I realize this negates an unattended reboot in a known state.
N2L
0 Kudos
Message 5 of 12
(4,835 Views)
tritone,

Thats a great idea, but Lookout doesn't allow you to specify different state file open and save paths. There is only one state file path parameter which can be set to "current directory" or "Lookout directory" only. Unfortunately this is not a runtime-writeable property, i.e. it can only be modified when in edit mode.

There is one thing you may be able to try though. Use the "Run" object in Lookout to copy a template state file to the state file that is used for your process before you load the process. It would be necessary to use a sequence object to set up the program flow.

1) Copy the read-only template state file to the read-write process state file.
2) Load the process

This process must be repeated every time the process is loaded(use the Loader object to load and close the process dynamically).

Regards,
Nick F.
Applications Engineer
National Instruments
~~
0 Kudos
Message 6 of 12
(4,826 Views)
Thanks for the ideas. I have noticed that using the same process on another Lookout installation does not produce the same error condition. It will generate a "cannot save state file" alarm, but the dialog that pops up on the others with "Cannot save state file" does not appear. It seems to be specific to the Lookout installation, rather than the process.
0 Kudos
Message 7 of 12
(4,819 Views)
When using Lookout 6.0 you will get an alarm by default if the state file is set to read-only when you close the process.

Could this be the discrepancy that you are seeing?

Regards,
Nick F.
Applications Engineer
National Instruments
~~
0 Kudos
Message 8 of 12
(4,812 Views)
Well, I am using 5.0, and what happens is this:

- I save and exit my process in the configuration that I want it to come up in.
- I go to the folder containing my process and make the .l4t read-only.
- I start my process back up and it comes up like it should.
- When I go to exit the process now, Lookout pops up a dialog box with the error message : "Cannot Open State file C:\Process.l4t for writing". I hit "OK" on the dialog box and the process closes.

In another Lookout installation (also v5.0) I can follow the above steps, and not get the dialog; instead I get an alarm that says "Cannot open state file for writing: C:\process.l4t". When I exit my process in this installation of Lookout, I don't get a dialog box or any other error messages, just the alarm.

I would like my other installation (that currently gives me the dialog box) to just give me the alarm when I exit. I wonder what it is about this particular install of Lookout 5.0 that makes the dialog box pop up?
0 Kudos
Message 9 of 12
(4,804 Views)
Am I correct in saying the state files are saved in a Citadel database?
If so, I read in my Lookout 6.0 help files that Citadel carries a 9 priority in database alarms.
Can this priortiy be changed to something less to stop the popup?

Also, I read that the "save state file" key in the Lookout.ini file can be manually changed to 0 so it doesn't try to save. If this key is set to 0 will it stop the state file from periodically updating or being written to on process closings?
N2L
0 Kudos
Message 10 of 12
(4,435 Views)