Creating a PLC project and integrating PLC libraries
Here you can unpack the complete PLC sources: TutorialSample.zip
- Start TwinCAT PLC Control.
- Create a new PLC project via File -> New. Select PC or CX (x86 or ARM) as the target system.
- 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. - Add second program block and rename it to P_SerialComm_HighSpeed.
- 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). - From the menu select Window -> Library Manager and then Insert -> Additional Library...
- Select TcIEC870_5_101Master.Lib from the list of TwinCAT libraries and confirm.