Command ‘Online Change’ΒΆ

Function: This command is used for initiating an online change on the current application. When this is done, CODESYS re-downloads only the changed parts of an application that is already running on the PLC.

Call: Menu bar: Online ; context menu of object: Application

Requirement: The application is in online mode.

The command is available in the context menu if an application is selected in the device tree. In this way, you can perform an online change just for one application, even if that application is not currently active.

An online change is not possible after the Clean all and Clean commands. The cleaning process deletes the compile information (build log) that was generated automatically at code generation. This log is the basis for an online change.

Caution

An online change changes the running application program and requires a restart.

Make sure that the new application code still has the required effect on the controlled system.

Depending on the controlled plant, the plant and workpieces may be damaged or the health and life of persons could be endangered.

Hint

If an online change is performed, then the application-specific initializations (example: homing) are not executed because the machine retains its status. For this reason, the new program code may not have the intended effect.

  1. Pointer variables retain their value from the last cycle. If a pointer refers to a variable whose value was changed in an online change, then the variable no longer yields the correct value. Make sure that pointer variables are re-assigned in each cycle.
  2. After the parent application has been changed, a child application is removed from the PLC when an online change is performed.

Hint

For compiler version 3.5.0.0 and later, a fast online change is performed for minor changes. In this case, only the modified blocks are compiled and downloaded. In particular, no initialization code is generated. This means that also no code is generated when variables with the init_on_onlchange attribute are initialized. As a rule, this has no effect because the attribute is used primarily for initializing variables with addresses. However, it cannot happen that a variable changes its address during an online change.

To secure the effect of the init_on_onlchange attribute in the entire application code, you must deactivate the fast online change in general for the application by using the compiler definition no_fast_online_change. To do this, insert the definition in the application Properties (Build tab).

At the time of download, CODESYS also lists the changed interfaces, affected variables, and all blocks with new generated code in the Build category of the message view. If memory locations change, a dialog will inform you of possible problems in conjunction with pointers.

Note

In the view Memory reserve for online change, memory reserves can be configured for the online change so that instance variables do not have to be moved in the memory when changing a function block in an online change.

See also