Problem

You want to use a function in a TwinCAT library. However, you can not access the function.

Solution

You need to add the library before before you can use the function.

  1. You need to figure out what library the function belongs to. Beckhoff System Information is a good place to start. It shows you what library the function belongs to. For example, the function to get and set TwinCAT device’s state is in TcEtherCAT.lib
  2. Click on insert in TwinCAT PLC Control.

    Select Insert
    Select Insert
  3. Alternatively, you can click on Windows and Select Library Manager. Then Right click to select Add Library.
    Add Library through Library Manager
    Add Library through Library Manager

    Right Click on Library Manager and Select Additional Library
    Right Click on Library Manager and Select Additional Library
  4. Find the library file and hit on Open

    Select Library
    Select Library
  5. All the functions in the library are ready to be used.

    Library Functions Ready
    Library Functions Ready