You are on page 1of 182

Welcome to PHOENIX CONTACT

PCWorx
Welcome to PHOENIX CONTACT
Software Architecture
Chapter 1 Chapter 1
Workspaces
Workspaces
Process data
assignment assignment
IEC
i
Bus
configuration
programming
Project
comparison comparison
Bus Structure
Workspace Workspace
Process Data
Assignment Workspace Assignment Workspace
Project Comparison
Workspace Workspace
IEC Programming
Workspace Workspace
Connected Bus
Device Catalog
Excel Link
Diag+ 2.0
Welcome to PHOENIX CONTACT
Hardware Architecture
Chapter 2 Chapter 2
Overview
Multitasking
Welcome to PHOENIX CONTACT
Communication PC - Control System
Chapter 3 Chapter 3
Welcome to PHOENIX CONTACT
Communication PC - Control System
Chapter 3 Chapter 3
Welcome to PHOENIX CONTACT
Communication
Paths
Serial
Interface Interface
TCP/IP
Welcome to PHOENIX CONTACT
Control System y
Network Settings
Setting the IP Adress/
Real-Time Clock on the Control System Real Time Clock on the Control System
Validation Validation
through
reset
Assigning the IP Address via BootP
BootP service
(default upon
delivery)
Entering the MAC Address
Activating the BootP Server Activating the BootP Server
See
address
sticker
Welcome to PHOENIX CONTACT
Network
Communication
Selecting the
Network Connection Network Connection
Manual
input of an
IP address
Connection
via station
name
Editing the
Station Names Station Names
Welcome to PHOENIX CONTACT
IBS Configuration
Chapter 4 Chapter 4
Welcome to PHOENIX CONTACT
Online
Configuration
Read-In of the Connected
Bus System Bus System
Inserting the Detected
Devices Devices
Welcome to PHOENIX CONTACT
Offline
Configuration
Insert Devices
From Device Catalog From Device Catalog
Insert to
same level
Insert
to branch
Device Replacement
Using the Device Catalog Using the Device Catalog
Device
replacemen
t
Welcome to PHOENIX CONTACT
Device Catalog and g
Device Files
Display
User-Defined
Device Catalog Device Catalog
Registration of Device Files
(Import) (Import)
N
E
W

XML
ICO
XML
Welcome to PHOENIX CONTACT
PN Configuration
Chapter 5 Chapter 5
Welcome to PHOENIX CONTACT
Basic Settings g
Setting the Address Area
First IP address
Last IP address
Subnetmask
192.168.0.2
192.168.0.254
255.255.255.0
Importing Addresses
Direct IP Address Assignment
192.168.0.2
Welcome to PHOENIX CONTACT
Online/Offline
Configuration
Offline Configuration
Online Configuration
Show Reachable Devices
Inserting Devices into the Project
Welcome to PHOENIX CONTACT
Device Settings g
Transmission Intervals
Device Names
PROFINET Devices in the Network
PROFINET Device Naming
Welcome to PHOENIX CONTACT
Process Data as Variables
Chapter 6 Chapter 6
Process Data
Assignment Workspace Assignment Workspace
PLC
address area
Modules Process
d t it f th b data items of the bus
1. Creating Process Data Variables
2. Connecting Process Data
Items with Global Variables Items with Global Variables
via Drag &Drop via Drag & Drop
via context menu
Global Variables
with Process Data Connection with Process Data Connection
C t Connecte
ddd
Created Created
automatically
Welcome to PHOENIX CONTACT
Data Management
Chapter 9 Chapter 9
Principle of Variable Declaration
Definition of the identifier: Character set for symbols
Assigning a data type: IEC 61131 data types
Use of variables: keywords
Variable address: Data management
Pre-initializing the variable: Syntax Pre initializing the variable: Syntax
Welcome to PHOENIX CONTACT
Elementary Data y
Types in IEC 61131
Hierarchy of Data Types
ANY_DATE STRING
ELEMENTARY
ANY_NUM TIME ANY_BIT
REAL
ANY_REAL
BOOL
BYTE
WORD
TIME_OF_DAY
DATE
DATE AND TIME
TIME STRING
LREAL
SINT
ANY_INT
WORD
DWORD
LWORD
DATE_AND_TIME
SINT
INT
DINT
USINT
UINT
LINT
UDINT
ULINT
Welcome to PHOENIX CONTACT
Constants - Literals
Syntax of Constants
<Data type>#<Basis>#<Constant value><Unit>
BYTE#2#0011_10
01
Constant of the
01
Tetrad
separator
type BYTE in
binary
representation
Example for the Representation
of Constants of Constants
12 0 12 456 986 I t t t #12456 -12 0 12_456 +986 Integer constants
-12.0 0.0 0.456 +2.635e-12 Real constants
Int#12456
Real#1.6e
3
Word#1209
4
Word constants
Word#16#2F3
E
Word#2#0010_1111_0011_11
10
also
BYTE and DWORD
Bool constants Bool#1
Time#1 64 t#2d 14h 3 5
Bool#0 True False
Time constants
Time#1.64
s
t#2d_14h_3.5
s
String constants String#Break? Right now, please!
Welcome to PHOENIX CONTACT
Use of Variables
Local Data
Global Data
Global Variables
Local Variables Local Variables
POU
variable tables
Global
variable tables
Local
variables
Interface
variables
Global
variables
Program
instance
Project
- - - - VAR
VAR_EXTERNAL_PG
VAR_EXTERNAL
VAR_GLOBAL
VAR_GLOBAL_PG
VAR_INPUT
VAR_OUTPUT VAR_EXTERNAL VAR_GLOBAL VAR
VAR_IN_OUT
VAR_INPUT - - - - VAR
Overview of
Use of Variables Use of Variables
Program
Function
block
Function
block
Globally
used
variables
VAR_EXTERNAL
VAR_EXTERNAL_PG
VAR_EXTERNAL
VAR_EXTERNAL_PG
VAR EXTERNAL FB
Local
interface
_ _
VAR_I NPUT
VAR OUTPUT
VAR_I NPUT
(o tp t declared interface
variables
Local
VAR_OUTPUT
VAR_I N_OUT
(output declared
separately)
VAR VAR VAR
variables
VAR VAR VAR
Graphical Overview of
Use of Variables Use of Variables
Program
FunctionBlock
Gl obVar
VAR INPUT
VAR_OUTPU
T
LocVar
VAR
LocVar
I nVar Out Var
_
LocVar
VAR_EXTERNA
Function
Gl obVar
L
LocVar
I nVar
Welcome to PHOENIX CONTACT
Managing Variables g g
Variable Groups
Standard
group
Edited:
Groups for
function
blocks
Edited:
Groups for
functions functions
Edited:
Groups for
programs
Variable Dialog
Access to local
variable table
Access to global
variable table
Local variable table
Global variable table
Welcome to PHOENIX CONTACT
Programming languages according to
IEC 61131 3 IEC 61131-3
Chapter 10 Chapter 10
The IEC 61131-3 Languages
Instruction list
Structured Text
Function block diagram Function block diagram
Sequential functional chart
Ladder diagram
Function Block Diagram (FBD)
Graphical language, widely used in Europe
Programming elements in form of function blocks g g
Function blocks can be " wired" similarly as in a circuit diagram
Used in a variety of applications responsible for the flow of
information between control system components.
B
C
AND
A
B
Ladder Diagram (LD)
Standardized limited set of programming Standardized, limited set of programming
symbols for relay control systems
Based on the North-American programming style, similar
to the US standard for drawing circuit diagrams to the US standard for drawing circuit diagrams
A B C
--| |----| / |--------------( )--
Instruction List (IL)
Assembler model using one accumulator Assembler model, using one accumulator
Per line one command is allowed,
e.g. saving a value in the accumulator
LD A
ANDN B
ST C
Structured Text (ST)
High level language structured through subprograms High-level language, structured through subprograms
Syntax similar to PASCAL
Complex and nested instructions
C := A AND NOT B;
Sequential Function Chart (SFC)
Step 1
Powerful, graphical programming
language for describing the sequence
b h i f t l Action 1 Step 1 behavior of control programs.
Used for structuring control problems
Transition 1
Action 1
Step 2 Action 2
Clearly arranged programming
language, allows for quick
diagnostics
Step 2
Transition 2
Action 2
Step 3
Bacic elements: Steps with action
blocks and transitions
Step 3
Supports alternative and parallel
sequences
Welcome to PHOENIX CONTACT
Programming in PC WORX
Chapter 11 Chapter 11
Welcome to PHOENIX CONTACT
Program g
Organization Units
Inserting POUs
Project tree ViewPOUs
Inserting
position in
project tree
Only
available for available for
functions
POU Properties
POU Groups
Welcome to PHOENIX CONTACT
Standard Functions
Standard Functions 1
_TO_... ANY
ANY
Data type conversion
F ti ith
ABS SQRT
ADD
ANY_REAL
ANY_NUM
ANY_REAL
ANY_NUM
Functions with a
numercal variable
St d d ith ti
ADD

EXPT
.
ANY_NUM
Standard arithmetic
functions
SHL

ROL
ANY_BIT
ANY_INT
ANY_BIT
Standard bit shift
functions
AND

XOR
ANY_BIT ANY_BIT
.
ANY_BIT
Bit-wise boolean
functions
Standard Functions 2
Selection functions
SEL

ANY BOOL/ANY
.
Selection functions
MUX
ANY
BOOL
ANY
Comparison functions
GT

NE
.
ANY
LEN

FIND
ANY_BIT
ANY_INT
ANY_BIT
String functions
LEFT

INSERT
ANY_DATE
ANY_DATE/ANY_INT
ANY_DATE
String functions
Welcome to PHOENIX CONTACT
Standard Function
Blocks
Standard Function Blocks 1
Falling
edge
Rising
edge
Edge evaluation Edge evaluation
Bistable blocks Bistable blocks
(flipflops)
Primary
reset
Primary
setting
Standard Function Blocks 2
Counter
counting
up/down
Counter
counting
down
Counter
counting
up
Counter
Timers
Impulse Switch off Switch on Impulse
encoder
Switch-off
delay
Switch-on
delay
Welcome to PHOENIX CONTACT
FBD - Function Block Diagramm
Chapter 12 Chapter 12
Language Elements of
Function Block Diagram Function Block Diagram
FB call FB call
FU call
Feedback
Green:
Project
FB/FU
Negatio Negatio
n
Blue:
Library
Diagram Diagram
in
FB/FU
FB/FU
FB/FU
Execution
order
Red:
Firmware FB/FU Firmware FB/FU
of IEC
Yellow:
FB/FU not
found
Accessing Variables
F5
Insert
mark
Marked
parameter
Accessing Functions
Accessing Function Blocks
Insert
mark
Editing Blocks
3
2 1
4
Welcome to PHOENIX CONTACT
IL - Instruction List
Chapter 14 Chapter 14
Language Elements
in Instruction List in Instruction List
Ld I xInput1 Ld I_xInput1
AndN I_xInput2
Not
St Q_xAccess1
Ld xPulse
St CTU_Access.CU
Ld iM i l
Assignments
and operators
Ld iMin
Limit iBasis, iMax
St iCorrected
Ld iMaximumvalue
St CTU_Access.PV
Ld xStop
St CTU_Access.RESET
FU calls
and arguments
FB calls
d t
Ld I_xInput1
JmpC JumpFlag
Cal CTU_Access
Ld CTU_Access.QV
St iDisplay
Ld CTU Access Q
and arguments
J pC Ju p ag

Ret
JumpFlag:
Ld I_xInput2
St Q A 1
Ld CTU_Access.Q
St xFull
Conditional
processing
St Q_xAccess1
Assignment and Operators
Ld I I t1
Loading an operand
Accumulato
r content
Ld I_xInput1
AndN I_xInput2
Loading an operand
into the accumulator
Linking the accumulator content
to the operand
E1
E1 * E2
_
Or I_xInput3
p
E1 * E2
E1 * E2 + E3
Linking the accumulator content
to the operand
St Q_xOutput1
E1 * E2 + E3
Saving the accumulator content
on the target operand
Operators in Instruction List
LD
ANY ANY_NUM ANY_BIT
LD
ST
Load
Save
AND
OR
XOR
And
Or
Exclusive Or
ADD
SUB
MUL
Addition
Subtraction
Multiplication
GT
Greater than
XOR
NOT
Exclusive Or
Complement
MUL
DIV
Multiplication
Division
ANY_NUM and ANY_BIT
GE
EQ
NE
Greater or equal
Equal
Not equal S
Set
JMP
RET
Jump
BOOL
NE
LE
LT
Not equal
Less or equal
Less than
S
R
Reset
RET
CAL
)
Return
FB call
Modifying the Operators
LdN I xInput1
E1 * E2 = E1 + E2
LdN I_xInput1
AndN I_xInput2
And( I_xInput3
Not
Or I_xInput4
)
St Q_xOutput1
Function Calls
1. Operand
explicitely loaded
Ld iMin
Limit iQuantity, iMax
St iCorrection St iCorrection
Ld wMin
Word_To_Int
accumulator
1. Operand
from the
accumulator
_ _
Limit iQuantity, iMax
St iCorrection
Editing in PC WORX
Inserting via the edit wizard
Comments as
dummies
LD (* IN as ANY_BIT *)
ROR (* N as ANY_INT *)
ST (* Result as ANY BIT *)
P t
ST (* Result as ANY_BIT *)
y
Parameter name
and
data type
After editing by user
Ld wRawsize
RoR INT#8 RoR INT#8
St wRotates
Function Block Calls
Ld I_xInput1
Data import
_
St
TON_Signal.IN
Ld tDelay Ld tDelay
St
TON_Signal.PT
Calculation
Cal TON_Signal
Ld TON_Signal.Q
St Q_xOutput1
Ld
Data export
Ld
TON_Signal.ET
St tSequence
Editing in PC WORX
Inserting
via the
edit
wizard a d
Declaration
dialog
LD xActivate
After editing
LD (* BOOL *)
ST TON_1.IN
LD (* TIME *)
ST TON_1.PT
LD xActivate
ST TON_1.IN
LD TIME#250ms
ST TON_1.PT
by the user
_
CAL TON_1
LD TON_1.Q
ST (* BOOL *)
LD TON_1.ET
CAL TON_1
LD TON_1.Q
ST xDelayed
_
ST (* TIME *)
ST xDelayed
LD TON_1.ET
ST tSequence
Conditional Code Execution
JMP | RET J |
Ld iRawsize
Skip marker
GT iMax
JmpC TooGreat
Ld iRawsize
Conditional
jump
Ld iRawsize
LT iMin
JmpC TooSmall
R t
Skip marker
Absolute
function block
Ret
TooGreat: Ld iMax
end
St iRawsize
Ret
TooSmall: Ld iMin TooSmall: Ld iMin
St iRawsize
Welcome to PHOENIX CONTACT
LD - Ladder Diagram
Chapter 15 Chapter 15
Welcome to PHOENIX CONTACT
Basic Elements
Editing in Ladder Diagram
s
Insert
element
s
Switch-through
options
Contact options
Coil options Coil options
Contact / Coil Dialog
Additional
g
Additional
options
compared to
variable dialog
Functions and Function Blocks
in Ladder Diagram in Ladder Diagram
Function
Functions Variables
blocks
Functions Variables
Formatting the Ladder Diagram
Arrange left
power rails
Arrange power
rails power rails rails
Welcome to PHOENIX CONTACT
SFC - Sequential Function Chart
Chapter 16 Chapter 16
Welcome to PHOENIX CONTACT
Basic Structure of
the Sequential
Function Chart
Sequential Function Chart POU
in the Project Tree in the Project Tree
POU
Transition
folder
POU
base element
Action
Transitio
n
in IL
Action
folder
Transitio
n
in LD
Action
in FBD
Basic Structure
Inserting the
basic
structure/
further steps
Step
Feedback
Action block
Transition
Welcome to PHOENIX CONTACT
Basic Elements
The Step
Standard step
Step flag
End step J ump Initial step
The Transition
Direct Connection
Elements from
LD and FBD
Transition as
direct connection direct connection
The Transition
Transition detail
Transition Transition
as detail
Transition name as
variable name
The Action Block
Inserting/Adding Inserting/Adding
an action block
Action block
as action detail
Action block
as boolean
parameter
Action
qualifier
Action Variable
Action Detail
Branches
Parellel/simultaneous Parellel/simultaneous Alternative Parellel/simultaneous Parellel/simultaneous
branch
Alternative
branch
Inserting Branches Later On
1
2
3
4
Welcome to PHOENIX CONTACT
User-Defined Data Types
Chapter 17 Chapter 17
Worksheets for
User-Defined Data Types User Defined Data Types
Welcome to PHOENIX CONTACT
Fields
Principle
WORD WORD
WORD
AR_1_4_W
WORD
WORD
Name example Name example
AR_<LowerBound>_<UpperBound>_<BasicType>
Declaration
TYPE
(*Typename*) : ARRAY [(*From..To*)] OF
(*Typename*);
END_TYPE
After editing by the user
T
One-dimensional
array
Type
AR_1_4_W : Array [1..4] Of Word;
AR 1 8 1 4 W : Array [1 8] Of AR 1 4 W;
array
T di i l
based
on
AR_1_8_1_4_W : Array [1..8] Of AR_1_4_W;
End_Type
Two-dimensional
array
Use in Programming
Assigning two array variables
of the same dimensions
arVariable1 := arVariable2;
A i i i l l Assigning a single value
to an element of an
array variable using a constant
Assigning a single value Assigning a single value
to an element of an
array varable using an index variable
Ld wVariable
St arVariable[iIndex]
Welcome to PHOENIX CONTACT
Structures
Principle
REAL REAL
INT
ST_Pump
INT
BOOL
Name example Name example
ST_<Function>
Declaration
TYPE
(*Typename*) :
STRUCT
(*Element 1 Name*) : (*DATATYPE*);
(*Element 2 Name*) : (*DATATYPE*);
(*Element 3 Name*) : (*DATATYPE*);
(* . : . *);
(* . : . *);
(*El t N *) (*DATATYPE*) (*Element n Name*) : (*DATATYPE*);
END_STRUCT;
END_TYPE
After editing by the user
Type Type
ST_Pump : Struct
rEngineCurrent : Real;
iFlow : Int;
iMediaTemperature : Int;
xBroken : Bool;
End_Struct;
End_Type
Use in Programming
Assigning two structure variables
of the same dimensions
tP 12 tP 13 stPump12 := stPump13;
Assigning a single value
to an element of a structure
variable using named parameters
Welcome to PHOENIX CONTACT
Combined User-
Defined Data Types
Declaration and Use
Type
ST_Pump : Struct
rMotorCurrent : Real;
Structure
iFlow : Int;
iMedTemperature : Int;
xBroken : Bool;
End_Struct;
Structure
declaration
_
AR_1_20_Pump : Array [1..20] Of ST_Pump;
End_Type
Array
declaration
Use in Programming
array variables of the same dimension
Assigning two complex
array variables of the same dimension
A i i t t i bl Assigning a structure variable
to an array element of a
complex array variable
Assigning a single value
arPumppark[12] := stPump12;
Assigning a single value
to an element of a
complex array variable
Ld iFlow_Pump12 _
St arPumppark[12].iFlow
Welcome to PHOENIX CONTACT
ST - Structured Text
Chapter 18 Chapter 18
Language Elements
of Structured Text of Structured Text
Q_xAccess1 := False;
Q xAccess2 := I xInput2 & Not I xInput4;
Assignments, operators
Q_ _ p _ p ;
If I_xInput1 & I_xInput2 Then
Q_xAccess1 := True;
ElsIf I_xAccess2 & I_xAccess3 Then
Q xAccess2 : True;
Requests
Q_xAccess2 := True;
End_If;
iCorrected := Limit(iMin, iBasis, iMax); FU calls and arguments
CTU_Access(CU := xPulse,
PV := iMaxvalue,
RESET := xStop);
iDisplay := CTU Access QV;
FB calls and arguments
iDisplay := CTU_Access.QV;
xFull := CTU_Access.Q;
Repeat
iLoop := iLoop + 1;
Loops
Until iLoop = 100
End_Repeat;
Loops
Assignments and Operators
Assignment
operator
Q xOutput1 := I xInput1 & Not I xInput2
11 22
Q_ p _ p _ p
Or I_xInput3;
Assignment direction Assignment direction
11 22
Assignment direction
11 22
Calculation
11
22
Assignment
Operator Hierarchy
Operation
Function(Arguments)
(Expression)
Function evaluation
Brackets
Symbol
ANY
*
Data type
group
Function(Arguments)
Function evaluation
iNumber1 ** iNumber2
Potentialization
Negation
Complement
-iNumber
NOT wCode
NUM
BIT
*
Multiplication
Division
Modulo
iNumber1 * iNumber2
rNumber1 / rNumber2
iNumber1 MOD iNumber2
Addition
iNumber1 + iNumber2
r
i
t
yNUM
*
*
*
Addition
Subtraction
iNumber1 + iNumber2
rNumber1 - rNumber2
Comparison
diA > diB wC < wD iE >= iF
Equality
iNumber1 = iNumber2
b 1 b 2
P
r
i
o
iG <= iH
ANY
*
*
*
Inequality
rNumber1 <> rNumber2
xVar1 XOR xVar2
Boolean exclusive OR
Boolean AND
xVar1 & xVar2
wCode1 AND wCode2
BIT
*
bVar1 OR bVar2
a O a
Boolean OR
Boolean exclusive OR
Function Calls
iCorrection := Limit(iMin,
iMeasuredvalue,
iMax);
Function
name
Function
arguments
iCorrection := Limit(iMin,
Word To Int(wRawsize), Word_To_Int(wRawsize),
iMax);
Return value of 1st function
as argument for 2nd function
Editing in PC WORX
Inserting via the edit wizard
Parameter name
Comments as
data type
and
data type
Comments as
dummies
(* Result as ANY_BIT *) := ROR((* IN as ANY_BIT *),(* N as ANY_INT *));
After editing by the user
wRotates := RoR(wRawsize, INT#8);
Function Block Calls
TON_Signal(IN := I_xInput,
PT := tDelay);
Data import
and calculation
Q_xOutput := TON_Signal.Q;
tSequence := TON Signal ET;
Data export
tSequence : TON_Signal.ET;
Alternative
call
TON_Signal.IN := I_xInput,;
TON Signal.PT := tDelay; _ g y
TON_Signal();
Q xOutput := TON Signal.Q; Q_ p _ g Q
tSequence := TON_Signal.ET;
Editing in PC WORX
Inserting
via the
edit
wizard
D l ti Declaration
dialog
TON_1(IN:=(* BOOL *), IN:=(* TIME *));
(* BOOL *):=TON 1 Q;
Data type only
( BOOL ):=TON_1.Q;
(* TIME *):=TON_1.ET;
Comments
as dummies
After editing by the user
TON_1(IN := xActivate,
PT := TIME#250ms);
xDelayed := TON_1.Q;
tSequence := TON_1.ET;
FU Call and FB Call in Comparison
Assignment via
function
Assignment
via order
iCorrection := Limit(iMin,
iMeasuredvalue,
FU
iMax);
TON Signal(IN := I xInput, TON_Signal(IN : I_xInput,
PT := tDelay);
Q_xOutput := TON_Signal.Q;
tS TON Si l ET
FB
A i t i tSequence := TON_Signal.ET;
Assignment via
Assignment via
named formal
parameters
Assignment via
output Parameters
Welcome to PHOENIX CONTACT
High-Level g
Language Elements
1
Th R t The Requests
If
Opening
keyword
If (* Boolean condition *) Then
(* Instructions *)
End If; End_If;
Closing
Instructions are only
processed by the control
t if diti i t
Closing
keyword
system if condition is met
If Extensions
If I_xSensor1 & Not I_xSensor2 Then _ _
(* Instructions 1 *)
ElsIf I_xSensor2 & Not I_xSensor1
Then
Repeatedly
optional
Then
(* Instructions 2 *)
Else
If iM d l < 100 Th
One-
time
optional
If iMeasuredvalue < 100 Then
(* Instructions 3 *)
ElsIf iMeasuredvalue > 100 Then
Nested
condition
(* Instructions 4 *)
End_If;
End If; End_If;
If Conditions
If I_xInput1 Then
(* I t ti 1 *)
Implicit request
f i bl
(* Instructions 1 *)
ElsIf iMeasuring >=
of a variable
Boolean result
iLimitedvalue Then
(* Instructions 2 *)
after operation
Boolean
ElsIf Byte_To_Bool(I_bSensor)
Then
(* I t ti 3 *)
return value of a
function
(* Instructions 3 *)
Else
Unconditioned
(* Instructions 4 *)
End If;
Case
Use for Process Values
Integer operand
Case iProcesssize Of
7 : (* Instructions 1 *)
-2..1 : (* Instructions 2 *)
2, 4 : (* Instructions 3 *)
" Case definitions"
8..16,
20..30 : (* Instructions 4 *)
Else
(* Instructions 5 *)
End Case;
One-
time
optional End_Case; optional
Case
Use for Control Values
Case iProcessstep Of
0 : (* Initialize *) ( )
If xInit_completed Then iProcessstep := 10;
End_If;
10 : (* Execute Prozess 1 *) 10 : (* Execute Prozess 1 *)
If xProcess1_completed Then iProcessstep := 20;
End_If;
20 : (* Execute Prozess 2 *)
If xProcess2_completed Then iProcessstep := 30;
End_If;
(* etc. *)
500 : (* Exceptionalhandling *)
iProcessstep := 0;
End_Case;
Welcome to PHOENIX CONTACT
High-Level g
Language Elements
2
Th L The Loops
For
Loop
variable
Start
value
End
value
Width of step
optional
For iIndex := 1 To 20 By 1 Do
(* The following instructions are executed with
1
*)
(* the values 1 to 20 for the variable iIndex
*)
If arrMachine[iIndex].iTemp >= iLimitvalue Then
arrMachine[iIndex].iBroken := True;
xAlarm := True;
Exit;
End_If;
End For;
20
Early
abortion of
loop
execution
d_ o ;
Repeat | While
Head-
controlled
Repeat until
Repeat
iIndex := iIndex +
10;
0
While
controlled
;
Until
iIndex >= iLimit
e
iIndex >= iLimit
Do
iI d iI d +
End_Repeat;
?
Foot-
controlled
iIndex := iIndex +
10;
End While;
controlled
_
As long as , do
Welcome to PHOENIX CONTACT
Project Management
Appendix A1 Appendix A1
Welcome to PHOENIX CONTACT
Project Files j
Saving... / Archiving
Save as ... Archiving
Welcome to PHOENIX CONTACT
CPU Control Dialogg
CPU Selection
Temporary Project - Bootproject
Welcome to PHOENIX CONTACT
Project Codes j
Memory Concept
Download bootproject
Download project
Reset
Archiving project via
FTP server
Compiled
machine code
Decodable
source code
Standard Archive
ZipFile.zwt
Welcome to PHOENIX CONTACT
Libraries
Appendix A2 Appendix A2
Library Directory
Welcome to PHOENIX CONTACT
Creating Libraries g
Saving
Removal and Compilation
Welcome to PHOENIX CONTACT
Using Libraries g
Including User Libraries
Including Firmware Libraries
The Library in a User Project
Using Projects
With Libraries With Libraries
Uncompiled
library
Help on Firmware Libraries
Welcome to PHOENIX CONTACT
Testing & Debugging
Appendix A3 Appendix A3
Status in Worksheets
Overwriting/Forcing
Powerflow (via Address Status)
Graphic
power
flow
Textual
power
flow
Information on Mouse Pointer
Tooltips Tooltips

You might also like