Creating a PLC project and integrating PLC libraries

Here you can unpack the complete PLC sources: TutorialSample.zip

  1. Start TwinCAT PLC Control.
  2. Create a new PLC project via File -> New. Select PC or CX (x86 or ARM) as the target system.
  3. A new MAIN program block will now be created automatically. Select ST (Structured Text) as the language for the block. Confirm.
    Rename the new program block to P_MAIN_LowSpeed.
  4. Add second program block and rename it to P_SerialComm_HighSpeed.
  5. Go to the task configuration and configure one fast task (T#1ms) and one slow task (T#10ms).
    Assign the P_SerialComm_HighSpeed to the fast task and the P_MAIN_LowSpeed to the slow task (see picture below).
    Creating a PLC project and integrating PLC libraries 1:
  6. From the menu select Window -> Library Manager and then Insert -> Additional Library...
  7. Select TcIEC870_5_101Master.Lib from the list of TwinCAT libraries and confirm.