What is initialization in PLC programming?

Hello everyone

I've just started programming PLCs. My question is, why do we initialize during programming? I saw a program in the TIA Portal that had individual markers called "Mirror Initialization." Why is this done?
Greeting

1 vote, average: 1.00 out of 1 (1 rating, 1 votes, rated)
You need to be a registered member to rate this.
Loading...
Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Santamon
1 year ago

The initialization in the PLC programming ensures that the control is set into a safe and predictable state before the actual control program is started.

In your case, the "Merker Initialization" in the TIA Portal could serve to prepare important things in the controller to ensure that everything is set correctly when the program starts.

Waldmensch70
1 year ago

My question would be why you initialize programming.

Thus, at the beginning, all outputs or memory cells are in a known state.

If the electrically connected outputs are (which can be switched on or off and which maintain this state until they get another command), then you do not know what state they are in. So you have to put them first on a defined state.

This is also quite common in various (other) programming languages, which one first initializes variables or also data fields in databases after generation to a standard value.

ohwehohach
1 year ago

Well, you need to have a defined state when your program starts and not some random – and that's why there is initialization code that creates this state.

In high programming languages, most data types have standard values ​​- if a variable is not initialized, it receives the default value. But that's what I don't know about PLC programming.