12 TwinCAT PLC Control
12 TwinCAT PLC Control
CONTENTS
CONTENTS
RS SR
UP-DOWN Counter
ON Delay Timer
Pulse Timer
Start
T/10ms
CONTENTS
Program
1. Can call other programs,
function blocks, and functions
2. Retains the state of local variables
between program calls
Function Block
1. Can call other function blocks and functions
2. Retains the state of local variables
between program calls
3. The function block program code
Function can be used repeatedly, in each case
1. Has no memory with a different memory
2. Returns the
result via the
function name LD Var1
ADD Var2
GE limit
ST enable
Blocks
n-1 cycle
n cycle
CONTENTS
CONTENTS
outputs
program
program
Process
Process
outputs
inputs
inputs
Write
Read
Read
Write
Write outputs
Windows NT
Read inputs
Read inputs
Read inputs
program
program
program
Process
and HMI
Process
Process
PLC cycle PLC cycle t
TwinCAT-Training: PLC Programming 33
Roland Chia / BASG
Implementation: Basic tasks of PC control Operation of a
software PLC and software NC on the PC
CONTENTS
Start TwinCAT
Automatic start of
TwinCAT
System Manager
1.
The user should know under
which PLC (runtime) the
project was configured in PLC
Control Number of
Run-Times
Run-Time selection
and PLC start
TwinCAT-Training: PLC Programming 38
Roland Chia / BASG
Creation of a boot project in PLC Control
Requirements:
1. The machine should
operate correctly.
2. Hardware, software and
links are correct.
3. PLC Control is logged in
CONTENTS
Notice on loading:
If the PLC project has been modified,
a message box saying „Load source
code into the controller?“ will appear
during loading.
On Demand:
The source code is only loaded into
the controller on request.
Online/Load source code
Scope:
Source code only;
The PLC project is written to the
control computer.
All files:
The PLC project including the
libraries is written to the control
computer.
CONTENTS
IMPORTANT!!!!
IMPORTANT!!!!
CONTENTS
RETAIN
PERSISTENT
Enable
archiving
Notes:
Remanent data (persistent and retain) are only stored if the
TwinCAT system service is terminated cleanly. This usually
involves using a UPS for shutting down the computer.
Data are also written if the computer is shut down manually
A new boot project has to be created if „persistent“ and
„retain“ variables are modified.
CONTENTS
CONTENTS
Mark variable 2x
Read/Write
Cross-references to:
Variables – bLamp_4
addresses - %QX20.3
blocks – Test5
TwinCAT-Training: PLC Programming 60
Roland Chia / BASG
Cross-reference list in the System Manager
(select)
Program flow
CONTENTS
Absolute password
(reading and writing)
2x
CONTENTS
2x
Zero corresponds
to the cycle time,
otherwise xx ms
Insert Trace
Variables
TwinCAT-Training: PLc Programming 77
Roland Chia / BASG
Trace configuration 3
Automatic
scaling