Using the PLC function block (PLC-FB)

The application of the PLC function block (PLC-FB, FB_<modelname>) in the PLC library is focused on its simple application. This is also accompanied by a few restrictions compared to the TcCOM (or the PLC Wrapper FB).

Application

Create one or more instances of the PLC-FB from the created PLC library. When writing the source code, the IntelliSense is available so that you can conveniently see the expected inputs and outputs.

Using the PLC function block (PLC-FB) 1:

If bus objects have been used as inputs or outputs in Simulink®, these data types are automatically defined as structures in the PLC library.

Restrictions

The PLC-FB does not allow access to the model parameters via properties at the function block. However, there are two ways to change the model parameters:

Also, the PLC-FB does not contain a block diagram in TwinCAT XAE. Debugging of the function block is done via the TwinCAT C++ Debugger, as described here or via External mode.