Control status of a digital input at startup of the plc

Hello.

Is it possible to control the state of a digital input at startup of the plc? If it is possible, what would be the function /blocked /library .... What should be used?

Thanks for your answers

Hi, I’m not sure what you mean - the state of each digital input at startup will be determined by the voltage level at each digital input channel.

If you are looking for a boolean variable in PLCnext Engineer that is true (or false) only during PLC startup, like the one in the Siemens "System Memory" byte, then you will need to do this yourself. If you can describe the requirements in your case, perhaps we can suggest a simple solution.

Hi. From your comment.

[quote] "If you are looking for a boolean variable in PLCnext Engineer that is true (or false) only during PLC startup, like the one in the Siemens "System Memory" byte, then you will need to do this yourself. If you can describe the requirements in your case, perhaps we can suggest a simple solution." [/quote].
That' s exactly what I need, to control the state of a boolean variable at the start of the PLC.
in my case, I want to execute a code depending on a variable, but only when the PLC starts up.

OK, in that case you can declare a BOOL variable in a suitable place - e.g. in the Global variable table, or as a local variable in one or more Programs.

You can initialse this BOOL as either FALSE (default) or TRUE. You can also set the "Retain" flag on this variable, if you don't want the variable to be re-initialised during a Warm start.

Then you will need to write some code that runs in a program instance that is executed at the [i]very end[/i] of the ESM Task(s) containing the program instance(s) where you use this BOOL variable. If your application is simple enough, e.g. with only one ESM task and only one program instance, then the code could be at the end of your program. The code should simply set the state of the BOOL variable to the opposite value, e.g. [b]Running := TRUE[/b]; (if the initial value of [b]Running[/b] is [b]FALSE[/b]).

You can then use this BOOL variable in conditional statements in your code, to do any first-pass initialisation.

Hello.

It is working.
Simple and easy things, that's what works.
Thanks