maxvoxel8 Posted April 16, 2019 Share Posted April 16, 2019 We have a pp_custom_save.tpl script which saves some variables. But they are initialized to 0 in the header files. We find that when we build and download, the variables are initialized to 0, and we would like to automatically run fload to give them their last-saved value. How can we do this? Link to comment Share on other sites More sharing options...
steve.milici Posted April 16, 2019 Share Posted April 16, 2019 This should be executed as the first thing in a “run once” power-on PLC. Link to comment Share on other sites More sharing options...
maxvoxel8 Posted April 17, 2019 Author Share Posted April 17, 2019 Is that defined in pp_startup.txt? We are using the default version which runs InitializePlc, and we do have fload in there. But that seems to only run when we actually restart the controller. Is it supposed to run when we just build and download? Link to comment Share on other sites More sharing options...
Omron Forums Support Posted April 29, 2019 Share Posted April 29, 2019 Startup PLC's would be enabled in pp_startup.txt with a line like "Enable PLC InitializePlc". pp_startup.txt should run on build and download. I just did a test on a CK3E with firmware 2.5 and it runs (just set a P Variable). Link to comment Share on other sites More sharing options...
maxvoxel8 Posted May 10, 2019 Author Share Posted May 10, 2019 Yes, we have an initialize PLC and it looks like it does run as it should. The issue is that if we've changed some variables and we build and download, the variables get initialized, and then the fload loads the last-saved values. What we need is some way to automatically run fsave before the build and download process starts to save the current values. Is there any way to do that? Link to comment Share on other sites More sharing options...
steve.milici Posted May 13, 2019 Share Posted May 13, 2019 Before a “Build and Download” the contents of the file “pp_disable.txt” is executed. This is probably not a good place for “fsave” as this command does not immediately finish execution. It must use the underlying Linux to create a file and there are no “timing” or “wait” features to hold off the continuation of the “Build and Download” to wait for the “fsave” to finish. This would be best done as an online command in the terminal window. Link to comment Share on other sites More sharing options...
maxvoxel8 Posted May 13, 2019 Author Share Posted May 13, 2019 Ok, thanks. Are you sure there is no way to delay execution by issuing a system command or something like that? As an aside, I see there is also pp_inc_disable and pp_inc_startup. What are these used for? Link to comment Share on other sites More sharing options...
steve.milici Posted May 14, 2019 Share Posted May 14, 2019 Ok, thanks. Are you sure there is no way to delay execution by issuing a system command or something like that? As an aside, I see there is also pp_inc_disable and pp_inc_startup. What are these used for? No - as "pp_startup.txt" is sent in a single communication thread. See the IDE manual under the chapter "The Configuration Folder" for a good description of pp_inc_disable.txt and pp_inc_startup.txt. Link to comment Share on other sites More sharing options...
Recommended Posts