Problem

Adding Function Block in Beckhoff TwinCAT structure text is not as straight forward as it should be in version 2.11 and before. There are some trick steps.

Steps to Add Function Block in Structure Text

  1. Move cursor to programing area where you want to add a function block.

    Function Block in Struture Text - 0 - ST
    Function Block in Struture Text - 0 - ST
  2. Hit F2 key, which brings up available function blocks. (If you need to use function blocks from other library, please add that library first).

    Hit F2 to Access Function Blocks
    Hit F2 to Access Function Blocks
  3. Select your function block.
  4. Rename the function block and declare it.

    Rename and Declare=
    Rename and Declare Variables
  5. Fill in all required variable.

    Declare Variables
    Declare Variables
  6. TON function block is running

    Running TON
    Running TON