Editors With this command all function blocks are displayed in a dialog box. You can choose whether to have a list displaying user-defined or standard function blocks. If one of the function blocks is selected and the dialog box is closed with OK, then the highlighted function block will be inserted at the current cursor position. If the With arguments option was selected in the dialog box, then the necessary input and output variables of the function block will also be inserted. Calling POUs with output parameters The output parameters of a called POU can be directly assigned upon being called in the text languages IL and ST. Example: Output parameter out1 of afbinst is assigned variable a.
IL: CAL afbinst(in1:=1, out1=>a) ST: afbinst(in1:=1, out1=>a); The text editors in Online mode The online functions in the editors are set breakpoint and single step processing (steps). Together with the monitoring, the user thus has the debugging capability of a modern Windows standard language debugger. In Online mode, the text editor window is vertically divided in halves. On the left side of the window you will then find the normal program text; on the right side you will see a display of the variables whose values were changed in the respective lines. The display is the same as in the declaration part.
That means that when the PLC is running, the present values of the respective variables will be displayed. The following should be noted when monitoring expressions or Bit-addressed variables: in the case of expressions, the value of the entire expression is always displayed. Example: a AND b is displayed in blue or with „:=TRUE“ if both a and b are TRUE. For Bit-addressed variables, the bit value that is addressed is always monitored (e.g. a.3 is displayed in blue or with „:=TRUE, if a has the value 4). If you place the mouse pointer briefly above a variable, then the type and the comment about the variable will be displayed in a Tooltip.
'Extras' 'Monitoring Options' With this command you can configure your monitoring window. In the text editors, the window is divided into two halves during monitoring. The pro-gram is located in the left half. In the right half, all variables that are located in the corresponding program line are monitored. You can specify the Monitor Window Width and which Distance two variables should have in a line. An distance declaration of 1 corresponds, in this case, to a line height in the selected font.
Monitoring Options Dialog Box Breakpoint Positions Breakpoint PositionsSince in TwinCAT PLC Control several IL lines are internally combined into a single C- code line, breakpoints can not be set in every line. Breakpoint positions include all positions in a program at which values of variables can change or where the program flow branches off. (Exception: function calls. If necessary, a breakpoint in the function must be set here.) At the positions lying inbetween, a breakpoint would not even make sense, since nothing has been able to change in the data since the preceding breakpoint position. This results in the following breakpoint positions in the IL:
At the start of the POU At every LD, LDN (or, in case a LD is located at a label, then at the label) At every JMP, JMPC, JMPCN At every label· At every CAL, CALC, CALCN At every RET, RETC, RETCN At the end of the POU TwinCAT 2 PLC Control 128 Version: 1.0