How can a desktop computer contain CFC

CFC editor in online mode

  1. PLC
  2. Reference programming
  3. Programming languages ​​and their editors
  4. Continuous Function Chart (CFC) and page-oriented CFC
  5. CFC editor in online mode

In online mode, you can monitor variable values ​​of the controller in the CFC editor and also change them. You can also use the debugging functions of TwinCAT, such as breakpoints and step-by-step execution.

Monitoring

Monitoring in the declaration part behaves like in all editors of the programming languages. You can find details on this in the help on the subject of "Monitoring".

In the online view of a function block, note that monitoring is only possible in the view of an instance; no values ​​are displayed in the view of the basic implementation.

The values ​​of Boolean connections are shown in different colors: TRUE = blue, FALSE = black.

Forcing / writing of variables

In online operation, you can prepare a value for forcing or writing a monitored variable in the declaration editor. See the “Monitoring Values” section for details.

If you have the option Prepare values ​​in the implementation part in the TwinCAT options in the category TwinCAT> PLC programming environment> CFC editor activated, you can also prepare values ​​in the implementation part. To do this, open the dialog Prepare value by double-clicking on the monitoring box next to the respective element or directly on the element. No dialog appears for Boolean variables, but every mouse click on the value shown next to the variable switches between the possible values ​​for forcing or writing. The prepared value is shown in angle brackets.

After writing or forcing has been carried out, a red "F" appears in the monitoring box.

Change constant input parameters of function block instances

You can also change input parameters of function block instances of the type VAR_CONSTANT in online mode and thus adjust the parameters. After logging out, you can then apply these parameters with the command Accept prepared parameter values in your project.

  • A CFC editor is active. A function block is instantiated that has VAR_INPUT CONSTANT variables in its declaration.
1. Open the POU by calling the function block instances in the editor.
2. Log in to the controller.
3. Click in the field parameter one of the function block instances.
4. Click in the column value in an inline monitoring field of a parameter.
5. Enter a new value in the field Prepare a new value for the next write or force operation a.
6. Confirm me OK.
7. Write the prepared value with the command Write values in the menu PLC or in the toolbar.
8. Close the dialog Edit parameters.
9. Log out.
10. Click in the field parameter one of the function block instances or mark the function block instance and select the command Edit parameters in the menu CFC.
11. Choose the command Save the prepared parameters in the project.
  • The changed parameter value is adopted in the project. The star next to the parameter field disappears.

See also:

Breakpoint positions in the CFC editor

You can always set a breakpoint at the positions of a block at which a variable value can change. Also at positions at which the program sequence branches or another block is called. In the following illustration, the red circles indicate possible breakpoint positions:

A breakpoint is automatically set in all methods that can be called.

© 2021 Beckhoff Automation