Beckhoff Automation GmbH & Co. KG TX1200 — 2.1 Project Components

A Brief Introduction to TwinCAT PLC Control in ST: Ergebnis := Fct(7, 2, 4); in FBD: In SFC, a function call can only be made within a step or transition. If you define a function in your project with the name CheckBounds [ } 218] , you can use it to check for range overflows in your project! The name of the function is defined and may have only this identifier. The following typical program for testing the CheckBounds function goes beyond the boundaries of a defined array. The CheckBounds functions makes sure that the value TRUE is not assigned to the position A[10], but rather to the upper area boundary A[7] which is still valid.

Therefore, the CheckBounds function can be used to correct extensions beyond array boundaries. If you define functions in your project with the name CheckDivByte , CheckDivWord , CheckDivDWord and CheckDivReal , you can use them to check the value of the divisor if you use the operator DIV, for example to avoid a division by 0. The name of the function is defined and may have only this identifier. If you define functions with the names CheckRangeSigned and CheckRangeUnsigned , then range exceeding of variables declared wit subrange types can be intercepted. All these check function names are reserved for the described usage.

Function block A function block is a POU which provides one or more values during the procedure. As opposed to a function, a function block provides no return value. Example in IL of a function block with two input variables and two output variables. One output is the product of the two inputs, the other a comparison for equality: TX1200 11 Version: 1.3