Can I configure the execution of an application (the executed cycles)?

You are able to configure most of the states in which the current application is being executed by the →runtime system .

Advanced user

The configuration and the following instruction is aimed at advanced users!
If you are not sure about some steps or the effects, logi.cals advised not to change the configuration. Moreover, back up your system data before making any changes so that you can restore the original data, if you experience any problems.

Graphical survey:

images/download/attachments/464159153/StateDiagramEN-version-1-modificationdate-1619534548691-api-v2.png
Explanation on the states (meanings: images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg = yes; images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg = no):

State

Meaning for application

Configurable?

Activated by default?

Init state

The application is executed in the initial state. The state can be deactivated/activated by means of a configuration file for the runtime system.
If the initial cycle is activated (this is the default), it is executed as a single cycle after the execution has been started. After this initial state, the application passes into the run state. A period between initial and run state is not defined and cannot be defined by the user.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg

Run state

The application is executed within the normal operation. You cannot deactivate the execution of the run state.
The run state is applied after the initial state (several cycles are possible in the run state), until the execution is stopped or the runtime system license expires (if you are operating the runtime system as a demo version) .

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg

Shutdown state

Stopping the application is being prepared. The state can be deactivated/activated by means of a configuration file for the runtime system. Moreover, the execution period of the state may be defined by means of a configuration file for the runtime system.
By default, the shutdown state is deactivated. If the shutdown cycle is activated, it is executed after the execution has been stopped (several cycles are possible in the shutdown state). The default configuration specifies a period of 3 seconds for the execution of the shutdown state.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg
(incl. execution period)

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

Term state

The application is within the last cycle before the application passes into the stop state. The state can be deactivated/activated by means of a configuration file for the runtime system.
If the term state is activated (this is the default), it is executed as a single cycle before the code execution is finally stopped. A period between the previous state and the term state is not defined and cannot be defined by the user.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg

Stop state

The application is not executed. You cannot deactivate the execution of the stop state.
The application can pass into the stop state due to the following reasons:

  • The execution has been stopped.

  • The runtime system license has expired (if you are operating the runtime system as demo version).

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg

How to configure these states:

  1. If the runtime system is running, terminate the runtime system . If you are using the built-in PLC, stop it.

  2. Open a command prompt on the target system or PC where the runtime system or logi.CAD 3 (if the built-in PLC is used) has been installed.
    Change to sub-directory PLC of the runtime system installation directory.
    If you are using the built-in PLC, go to the Windows folder where you installed logi.CAD 3. Then go to this sub-folder: plugins\com.logicals.ptk.win32.win_x.y.z\rts (x.y.z is a placeholder for the respective version number of logi.CAD 3.)

  3. Open file RTSIO.cfg in any text editor, search for the line Flags and change the entered value to one of the following values.
    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg These values are applied for →tasks with a cycle time ≠ 0 (= for a periodic execution).

    Value

    Activated states

    Note

    0

    run state + stop state

    Run state and stop state are always activated – no matter which value is entered in the line.

    1

    init state + run state + stop state


    2

    run state + term state + stop state


    3

    init state + run state + term state + stop state

    Line Flags 3 is entered in the default configuration.
    Therefore, all states but the shutdown state are activated.

    8

    run state + shutdown state + stop state


    9

    init state + run state + shutdown state + stop state


    10

    run state + shutdown state + term state + stop state


    11

    init state + run state + shutdown state + term state + stop state


  4. Save the changed file RTSIO.cfg.

  5. If you want to define the execution period of the shutdown state, perform the following steps, too:

    1. Open file RTS.cfg in any text editor, search for the following lines and change the entered value (the values are interpreted as milliseconds).

      Line

      Meaning

      Example

      AddSymbol Shutdown.Timeout

      period for execution of the shutdown state
      logi.cals recommends a period of 3 seconds at most (= value 3000 or less).
      If you specify a longer period, logi.CAD 3 might report a timeout when loading/stopping the application.

      AddSymbol Shutdown.Timeout 3000

      AddSymbol Shutdown.CheckDelay

      check interval for sequence of Shutdown.Timeout

      AddSymbol Shutdown.CheckDelay 500

      TriggeredTasks.HaveInitCycle

      only possible for Windows and platform LinuxX86: activate or deactivate the init state for →tasks with a cycle time 0 (= for a triggered execution)
      In case of value 0 ( = default behavior), the init state is deactivated for these tasks. In case of other values, the init state is activated.

      TriggeredTasks.HaveInitCycle 1
    2. Save the changed file RTS.cfg.

  6. Restart the runtime system on the Windows PC. If you are using the built-in PLC, start it.

Consider the possible effect, if you have deactivated the init state, shutdown state and/or term state: Concerning the RTSCycleInfo block, its outputs evaluating the status of the appropriate state will always return value FALSE (or an equivalent).

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg logi.cals recommends to install and use the most current versions of logi.CAD 3 and the runtime system so that the latest features and problem fixes according to the release notes are provided in the used version.


Did this article help you? Did you find the requested information in this user documentation?
If not, contact the support team of logi.cals. State your questions or suggestions to improve/enhance the user documentation as detailed as possible.