Debugging, Online Functions

Sampling Trace

The sampling trace allows you to trace the value sequence of variables, depending upon the so-called trigger event. This is the rising edge or falling edge of a previously defined Boolean variable (trigger variable). TwinCAT PLC Control permits the tracing of up to 20 variables. There is a 64 kB ring buffer.

Debugging

The debugging functions of TwinCAT PLC Control make it easier for you to find errors.

Breakpoint

A breakpoint is a place in the program at which the processing is stopped. Thus it is possible to look at the values of variables at specific places within the program.
Breakpoints can be set in all editors. In the text editors breakpoints are set at line numbers, in FBD and LD at network numbers, and in SFC at steps.
No breakpoints can be set in function block instances.

Single step

Single step means:

By proceeding step by step you can check the logical correctness of your program.

Single cycle

If Single cycle has been chosen, then the execution is stopped after each cycle.

Change values online

During operations variables can be set once at a certain value (write value) or also described again with a certain value after each cycle (force value). In online mode one also can change the variable value by double click on the value. By that boolean variables change from TRUE to FALSE or the other way round, for each other types of variables one gets the dialog Write Variable xy, where the actual value of the variable can be edited.

Monitoring

In Online mode, all displayable variables are read from the controller and displayed in real time. You will find this display in the declarations and program editor; you can also read out current values of variables in the watch and recipe manager and in a visualization. If variables from instances of function blocks are to be monitored, the corresponding instance must first be opened.

In monitoring VAR_IN_OUT variables, the de-referenced value is output. With a simple click on the cross or a double-click on the line, the display is either expanded or truncated.

In monitoring pointers, both the pointer and the de-referenced value are output in the declaration portion. In the program portion, only the pointer is output:

+ --pointervar = '<'pointervalue'>'

POINTERs in the de-referenced value are also displayed accordingly.
With a simple click on the cross or a double-click on the line, the display is either expanded or truncated.

Monitoring of ARRAY components: In addition to array components indexed by a constant, components are also displayed which are indexed by a variable:
anarray[1] = 5
anarray[i] = 1
If the index consists of an expression (e.g. [i+j] or [i+1]), the component can not be displayed.

Simulation

During the simulation the created PLC program is not processed in the PLC, but rather in the calculator on which TwinCAT PLC Control is running. All online functions are available. That allows you to test the logical correctness of your program without PLC hardware.

Simulation mode is only available for the Buscontroller (BCxx00). If you use TwinCAT on the PC (Code generation i386) you can simulate the program direct in the runtime system without having physical I/O.

Log

The log chronologically records user actions, internal processes, state changes and exceptions during Online mode processing. It is used for monitoring and for error tracing.