PLC ST Basic 2, 3, 4

Reference

https://www.youtube.com/watch?v=mHq9QihUDUU&t=10s

EP2

Install TwinCat XAE(extended automation engineering)

https://www.beckhoff.com/english.asp?download/tc3-downloads.htm

Create project

File -> new -> project -> TwinCat XAE prject(XML format) -> input file name & ok

Solution Explorer -> PLC right click to 'add new items'-> standard project

Renew licence

Solution Explorer -> SYSTEM -> License -> 7 day trial license

Overview

DUT = data unit type

GVL = global variable

POU = program organization unit

First Run

Solution Explorer -> TwinCat -> SPS -> new element -> standard plc project -> enter name: code_X-> OK

Solution Explorer -> TwinCat -> SPS -> code_X -> POUs -> MAIN (PRG)

---------------------------------
PROGRAM MAIN
VAR
    x : BOOL;
END_VAR
---------------------------------
x := TRUE;
---------------------------------

input_code -> active configuration -> login -> start

EP3

Check SYSTEM performance

Solution Explorer -> SYSTEM -> Real-Time -> Online window

Adjust Cycle time

Solution Explorer -> SYSTEM -> Tasks -> PLC task -> task window -> cycle ticks input -> 1 => active configuration -> login -> start

When we set cycle ticks to 1 ms, each cycle will be 1ms.

If the process finsished before 1ms, e.g. 0.5ms, the system will wait till 1ms, then to start next cycle.

EP4

datatypes

https://infosys.beckhoff.com/english.php?content=../content/1033/tcplccontrol/html/tcplcctrl_plc_data_types_overview.htm&id

Last updated

Was this helpful?