Beckhoff Automation GmbH & Co. KG TX1200 — 2.2.8 Debugging, Online Functions

A Brief Introduction to TwinCAT PLC Control Coils can also be defined as set or reset coils. One can recognize a set coil by the "S" in the coil symbol: (S)) It never writes over the value TRUE in the appropriate Boolean variable. That is, if the variable was once set at TRUE, then it remains so. One can recognize a reset coil by the "R" in the coil symbol: (R)) It never writes over the value FALSE in the appropriate Boolean variable: If the variable has been once set on FALSE, then it remains so. LD as FBD When working with LD it is very possible that you will want to use the result of the contact switch for controlling other POUs.

On the one hand you can use the coils to put the result in a global variable which can then be used in another place. You can, however, also insert the possible call directly into your LD network. For this you introduce a POU with EN input. Such POUs are completely normal operands, functions, programs, or function blocks which have an additional input which is labeled with EN. The EN input is always of the BOOL type and its meaning is: The POU with EN input is evaluated when EN has the value TRUE. An EN POU is wired parallel to the coils, whereby the EN input is connected to the connecting line between the contacts and the coils.

If the ON information is transmitted through this line, this POU will be evaluated completely normally. Starting from such an EN POU, you can create networks similar to FBD. Part of a LD Network with an EN POU 2.2.8 Debugging, Online Functions Sampling Trace [ } 175] 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 [ } 103] 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: In IL: Execute the program until the next CAL, LD or JMP command. In ST: Execute the next instruction. In FBD, LD: Execute the next network. In SFC: Continue the action until the next step. In CFC: Execute the next POU (Box) in the CFC program.

By proceeding step by step you can check the logical correctness of your program. Single cycle TX1200 29 Version: 1.3