Command ‘Login’

Symbol: f7339dad366f5b2ec0a8640e002c9fcf_c0a62538f5e142d5c0a8640e003c18fa ; keyboard shortcut: Alt+F8.

Function: This command connects the application to the target system (PLC to simulated device) and starts the online mode.

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

Requirement: The application contains no errors and the communication settings are configured.

A dialog prompt opens if the communication settings are incorrect. You can then switch directly to the Communication Settings of the PLC.

If you click Login from the online menu, then the currently active application is connected to the target system. If you choose this command from the shortcut menu (right-click) while an application is selected in the device tree, then that application is logged in, even if it is not set as the active application.

If an online user management is configured on the target device, then you are prompted for user data when you log in. The Device User Login dialog box opens.

Caution

:strong:Check controller accessibility

For security reasons, controllers should not be accessible from the Internet or untrusted Networks under any circumstances! In particular, the TCP/IP programming ports (usually UDP-Ports 1740..1743 and TCP-Ports 1217 + 11740 or the controller specific ports) should not be accessible from the internet without protection. In case Internet access to the controller is needed, using a a safe mechanism is absolutely mandatory, such as VPN and password protection of the controller.

see also: Managing Users on the Controller

Attention

If a safety controller is inserted below a PLC, then this command can temporarily interrupt the communication links of the safety controller to other safety controllers (via safety network variables), to field devices, and to the development system. The safe field devices and the other safety controller can enter the safe state as a reaction. The connection to the development system is affected only in the case of a safety controller that is connected to the main controller via a fieldbus. For more information, refer to the section “Subordinate Safety Controllers”.

Possible situations when logging in:

  • A later version of the device description (than in the project) is on the PLC. A warning prompt is displayed with the option to cancel the process.

  • The application does not exist on the PLC: You are prompted to confirm the download.

  • The application is already on the PLC and has not been changed since the last download. The login continues without any more prompts.

  • The application exists on the PLC, but it has been changed since the last download.

    You are prompted to select one of the following options:

    • Login with online change (Please note the information about online changes in the help page “Command ‘Online Change’ “.)
    • Login with download
    • Login without any change

    At this point, there is also the option of updating the boot application on the PLC.

  • An unknown version of the application exists on the PLC. CODESYS prompts you to replace it.

  • A version of the application exists on the PLC and is running. CODESYS prompts you to login anyway and overwrite the currently running application.

  • The application on the PLC is currently halted at a breakpoint. You are logged out and the program has been changed: CODESYS prompts you with a warning that the PLC will be stopped completely if an online change or download occurs. This happens also if several tasks exist and the breakpoint affects only one of them.

Click Details in the dialogs above to open the Application Information dialog box.

See also

Dialog box ‘Application Information’ (Details)

This dialog box provides two tabs with comparative information about the application changed in the development system and its previous version currently located on the PLC.

  • Application information: The application properties of the Application in the IDE (Integrated Development Environment) are compared with those of the Application in the PLC: Project name, Last modification, IDE version, Author, Description. In addition, CODESYS shows the objects that have changed since the last download.

  • Application contents: When the option Download Application Info is selected, the contents of the applications on both the (1) development system and (2) PLC can be compared. The Download Application Info option is located in the Application Build Options tab of the application properties.

    If the code in the development system is not current, then (3) Application not up to date. Generate code now? appears at the bottom left of the dialog box. Execute this command to update the application source code.

    This detailed information can help you to better assess the effects of login in the current situation and to make a decision about downloading the new application.

Note

The comparison can also be displayed in the device editor (Applications tab) by clicking Content.

See also

Unknown applications in the PLC

If one or more applications are already on the PLC, but are not in the project, then CODESYS opens a dialog box with a list of these applications. You can then define whether an application should be deleted before loading the current application from the PLC. This also applies to child applications that are on the PLC, but have been deleted from the project in the meantime.

Compiling the project before login

If an application program has not been compiled since the last change, then CODESYS compiles the project before login. This process is the same as the Build command when logged out.

If compile errors occur, then a dialog prompt opens. The errors are printed to the messages view (Build category). You can then decide whether or not you log in without downloading the program to the PLC.

See also

Error at login

If an error occurs when logging in to the PLC, then CODESYS cancels the loading process with an error message. The error dialog gives you the options of showing the error details. If an exception was thrown and the text *SOURCEPOSITION* is included in the log, then you can display the affected function in the editor by clicking Show in Editor. The cursor jumps to the line containing the error.

Messages during the download process

If CODESYS downloads the project to the PLC at login, then the following information is printed to the messages view:

  • Generated code size
  • Size of the global data
  • Resulting memory requirement on the PLC
  • List of the affected blocks (for online change)

Note

In online mode, you cannot change the settings of the devices or modules. You must log out of the application for changing device parameters. Depending on the bus system, there may be some special parameters that you can also change in online mode.

Note

CODESYS saves the view configuration separately in online and offline mode. In addition, views are closed that cannot be used in any operating mode. Due to this, the view can change automatically at login.