Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to run fload on build and download?
#1
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?
Reply
#2
This should be executed as the first thing in a “run once” power-on PLC.
Reply
#3
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?
Reply
#4
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).
Reply
#5
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?
Reply
#6
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.
Reply
#7
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?
Reply
#8
(05-13-2019, 01:25 PM)maxvoxel8 Wrote: 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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)