Online Functions
Online Functions
The available online commands are assembled under the menu item "Online". The execution of some of the
commands depends upon the active editor. The online commands become available only after logging in.
Thanks to 'Online Change' functionality you have the possibility of making changes to programs on the running
controller. See in this connection 'Online' 'Log-in'
'Online' 'Download'
This command loads the compiled project in the PLC (download, not to mistake with 'Online''download source
code'!).
Download information is saved in a file called <projectname>0000000ar.ri , which is used during Online Change to
compare the current program with the one most recently loaded onto the controller, so that only changed program
components are reloaded. This file is erased by the command 'Project' 'Clear all'.
'Online' 'Reset'
This command resets - with exception of the retain variables (VAR RETAIN) - all variables to that specific value, with
which they have got initialized (also those variables which have been declared as VAR PERSISTENT !). If you have
initialized the variables with a specific value, then this command will reset the variables to the initialized value. All
other variables are set at a standard initialization (for example, integers at 0). As a precautionary measure, TwinCAT
PLC Control asks you to confirm your decision before all of the variables are overwritten. The situation is that which
occurs in the event of a power failure or by turning the controller off, then on (warm restart) while the program is
running. Use the 'Online' 'Run' command to restart the program.
For non-boolean variables a double mouse click in performed on the line in which a variable is declared, or
the variable is marked and the <Enter> key is pressed. The dialog box 'Write variable <x>' then appears, in
which the value to be written to the variable can be entered.
Dialog Box for Writing a New Variable Value.
For boolean variables, the value is toggled (switched between TRUE and FALSE, with no other value
allowed) by double-clicking on the line in which the variable is declared; no dialog appears.
The value set for Writing is displayed in brackets and in turquoise colour behind the former value of the variable. e.g.
a=0 <:=34>.
Note:
Exception: In the FBD and LD Editor the value is shown turquoise without brackets next to the variable name.
Set the values for as many variables as you like.
The values entered to be written to variables can also be corrected or deleted in the same manner. This is likewise
possible in the 'Online' 'Write/Force dialog' (see below).
The values to be written that were previously noticed are saved in a writelist (Watchlist), where they remain until
they are actually written, deleted or transferred to a forcelist by the command 'Force values'.
2. Write the values
The command to Write Values can be found at two places:
Note:
In the sequential function chart language (SFC), the individual values from which a transition expression is
assembled cannot be changed with 'Write values'. This is due to the fact that in monitoring the 'Total value' of the
expression, not the values of the individual variables are displayed (e.g. "a AND b" is only displayed as TRUE if both
variables actually have the value TRUE).
In FBD, on the other hand, only the first variable in an expression, used for example as input to a function block, is
monitored. Thus a 'Write values' command is only possible for this variable.
Note:
The forcelist is created at the first forcing of the variables contained in the writelist, while the writelist existed prior to
the first writing of the variables that it contains.
The command for forcing a variable, which means that it will be entered into the forcelist can be found at the following
places:
Note:
In the sequential function chart language, the individual values from which a transition expression is assembled
cannot be changed with 'Force values'. This is due to the fact that in monitoring the 'Total value' of the expression,
not the values of the individual variables are displayed (e.g. "a AND b" is only displayed as TRUE if both variables
actually have the value TRUE).
In FBD, on the other hand, only the first variable in an expression, used for example as input to a function block, is
monitored. Thus a 'Force values' command is only possible for this variable.
A double mouse click on a line, in which a non boolean variable is declared, opens the dialog ‘Write variable
<x>’. Press button <Release Force for this variable> .
Repeat double mouse clicks on a line in which a boolean variable is declared to toggle to the display
<Release Force> at the end of the line.
In the menu ‘Online’ open the Write/Force-Dialog and delete the value in the edit field of the column ‘Forced
value’.
When for all desired variables the setting “<Release Force>” is shown in the declaration window, choose the
command‘Force’ to transfer the modifications of the forcelist to the program.
If the current writelist (see 'Online' 'Write Values') is not empty while you execute the command ‘Release Force’, the
dialog 'Remove Write-/Forcelist’ will be opened. There the user has to decide whether he just wants to Release
Force or additionally wants to Remove the writelist or if he wants to remove both lists.
'Online'Write/Forcen Dialog'
This command leads to a dialog which displays in two registers the current writelist (Watchlist) and forcelist
(Forcelist). Each variable name and the value to be written to it or forced on it are displayed in a table.
The variables reach the watchlist via the commands 'Online' 'Write Values' and are transferred to the forcelist by the
command 'Online' 'Force Values'. The values can be edited here in the „Prepared Value“ or „Forced Value“ columns
by clicking the mouse on an entry to open an editor field. If the entry is not type-consistent, an error message is
displayed. If a value is deleted, it means that the entry is deleted from the writelist or the variable is noticed for
suspension of forcing as soon as the dialog is closed with any other command than Cancel.
The following commands, corresponding to those in the Online menu, are available via buttons:
Force Values: All entries in the current writelist are transferred to the forcelist, that is the values of the variables in
the controller are forced. All variables marked with 'Release Force' are no longer forced. The dialog is then closed.
Write Values: All entries in the current writelist are written once only to the corresponding variables in the controller.
The dialog is then closed.
Release Force: All entries in the forcelist will be deleted or, if a writelist is present, the dialog “Delete write-/forcelist”
comes up, in which the user must decide whether he only wants to release forcing or discard the writelist, or both.
The dialog will close at that point, or after the selection dialog is closed as the case may be.
'Online' 'Show Call Stack'
You can run this command when the PLC stops at a breakpoint. You will be given a dialog box with a list of the POUs
currently in the Call Stack
Example of a Call Stack
The first POU is always the in the appointed debug task called program, because this is where the executing begins.
The last POU is always the POU being executed. After you have selected a POU and have pressed the Go to button,
the selected POU is loaded in its editor, and it will display the line or network being processed.
'Online' 'Simulation'
Simulation Mode is only accessibly for Buscontroller BC and not for TwinCAT PC. If Simulation Mode is chosen, then
a check will appear in front of the menu item. In the simulation mode, the user program runs on the same PC under
Windows. This mode is used to test the project. The communication between the PC and Simulation Mode uses the
Windows Message mechanism. If the program is not in simulation mode, then the program will run on the PLC. The
status of this flag is stored with the project.
'Online' 'Communication Parameters'
The parameters for transferring through the serial interface can be entered in a dialog box. It is important that these
parameters agree with those entered in the PLC .
Possible adjustments include: the baudrate; whether the transfer should be made with Even, Odd, or No Parity; the
number of Stop Bits; and also the interface (COM1, COM2, etc.) via which the transfer is to occur. The selected
parameters are stored with the project.
The runtime system information will be stored in the PLC project file after saving. Therefore, the selected port number
is visible then in the TwinCAT System Manager configuration after a rescan.
The following menue entries are enabled, if the target system is BCxxxx:
'Online' 'coupler'
The following special commands are available:
K-Bus Reset: A reset of the Terminal bus is performed
Coupler Reset: The coupler will be restarted
Vendor Configuration: The factory default settings will be loaded (Boot Project erased), the coupler must be
subsequently restarted by initiating a coupler reset.
Start Cycle Time Measuring: The cycle-time measurement on the BCxxxx will be started.
Stop Cycle Time Measuring: The cycle-time measurement on the BCxxxx will be stopped
Read Cycle Time Measuring: he minimum cycle-time (since measurement start), maximum cycle-time, average
cycle-time (taken from the last 200 cycles) , actual cycle-time and the number of PLC-cycles will be read.
Set Cycle Time: The target cycle-time and background task time can be set here. If the actual cycle-time exceeds
the target cycle-time the next cycle-time will be correspondingly late (there is no longer a constant cycle). In general
the target cycle-time is calculated as follows: 1.25 times the average cycle-time (from cycle measure read),
background task time: 0.25 times the average cycle-time. The time can be set to a specified value to an accuracy of
1ms.