pcworx detail
TRANSCRIPT
![Page 1: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/1.jpg)
Welcome to PHOENIX CONTACT
PCWorx
![Page 2: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/2.jpg)
Welcome to PHOENIX CONTACT
Software Architecture
Chapter 1Chapter 1Workspaces
![Page 3: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/3.jpg)
Workspaces
Process dataassignmentassignment
IECiBus
configuration
programming
Projectcomparisoncomparison
![Page 4: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/4.jpg)
Bus StructureWorkspaceWorkspace
![Page 5: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/5.jpg)
Process Data Assignment WorkspaceAssignment Workspace
![Page 6: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/6.jpg)
Project ComparisonWorkspaceWorkspace
![Page 7: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/7.jpg)
IEC ProgrammingWorkspaceWorkspace
![Page 8: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/8.jpg)
Connected Bus
![Page 9: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/9.jpg)
Device Catalog
![Page 10: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/10.jpg)
Excel Link
![Page 11: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/11.jpg)
Diag+ 2.0
![Page 12: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/12.jpg)
Welcome to PHOENIX CONTACT
Hardware Architecture
Chapter 2Chapter 2
![Page 13: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/13.jpg)
Overview
![Page 14: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/14.jpg)
Multitasking
![Page 15: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/15.jpg)
Welcome to PHOENIX CONTACT
Communication PC - Control System
Chapter 3Chapter 3
![Page 16: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/16.jpg)
Welcome to PHOENIX CONTACT
Communication PC - Control System
Chapter 3Chapter 3
![Page 17: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/17.jpg)
Welcome to PHOENIX CONTACT
Communication Paths
![Page 18: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/18.jpg)
SerialInterfaceInterface
![Page 19: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/19.jpg)
TCP/IP
![Page 20: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/20.jpg)
Welcome to PHOENIX CONTACT
Control System yNetwork Settings
![Page 21: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/21.jpg)
Setting the IP Adress/Real-Time Clock on the Control SystemReal Time Clock on the Control System
ValidationValidationthrough
reset
![Page 22: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/22.jpg)
Assigning the IP Address via BootP
BootP service(default upon
delivery)
![Page 23: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/23.jpg)
Entering the MAC AddressActivating the BootP ServerActivating the BootP Server
See addresssticker
![Page 24: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/24.jpg)
Welcome to PHOENIX CONTACT
Network Communication
![Page 25: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/25.jpg)
Selecting the Network ConnectionNetwork Connection
Manualinput of anIP address
Connection via station
name
![Page 26: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/26.jpg)
Editing theStation NamesStation Names
![Page 27: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/27.jpg)
Welcome to PHOENIX CONTACT
IBS Configuration
Chapter 4Chapter 4
![Page 28: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/28.jpg)
Welcome to PHOENIX CONTACT
Online Configuration
![Page 29: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/29.jpg)
Read-In of the ConnectedBus SystemBus System
![Page 30: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/30.jpg)
Inserting the DetectedDevicesDevices
![Page 31: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/31.jpg)
Welcome to PHOENIX CONTACT
Offline Configuration
![Page 32: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/32.jpg)
Insert Devices From Device CatalogFrom Device Catalog
Insert to same level
Insertto branch
![Page 33: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/33.jpg)
Device ReplacementUsing the Device CatalogUsing the Device Catalog
Device replacemen
t
![Page 34: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/34.jpg)
Welcome to PHOENIX CONTACT
Device Catalog and gDevice Files
![Page 35: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/35.jpg)
Display
![Page 36: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/36.jpg)
User-DefinedDevice CatalogDevice Catalog
![Page 37: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/37.jpg)
Registration of Device Files(Import)(Import)
NEW
XML ICOXML
![Page 38: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/38.jpg)
Welcome to PHOENIX CONTACT
PN Configuration
Chapter 5Chapter 5
![Page 39: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/39.jpg)
Welcome to PHOENIX CONTACT
Basic Settingsg
![Page 40: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/40.jpg)
Setting the Address Area
First IP addressLast IP addressSubnetmask
192.168.0.2192.168.0.254255.255.255.0
![Page 41: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/41.jpg)
Importing Addresses
![Page 42: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/42.jpg)
Direct IP Address Assignment
192.168.0.2
![Page 43: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/43.jpg)
Welcome to PHOENIX CONTACT
Online/Offline Configuration
![Page 44: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/44.jpg)
Offline Configuration
![Page 45: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/45.jpg)
Online Configuration
![Page 46: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/46.jpg)
Show Reachable Devices
![Page 47: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/47.jpg)
Inserting Devices into the Project
![Page 48: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/48.jpg)
Welcome to PHOENIX CONTACT
Device Settingsg
![Page 49: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/49.jpg)
Transmission Intervals
![Page 50: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/50.jpg)
Device Names
![Page 51: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/51.jpg)
PROFINET Devices in the Network
![Page 52: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/52.jpg)
PROFINET Device Naming
![Page 53: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/53.jpg)
Welcome to PHOENIX CONTACT
Process Data as Variables
Chapter 6Chapter 6
![Page 54: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/54.jpg)
Process Data Assignment WorkspaceAssignment Workspace
PLC address area
Modules ≈ Process d t it f th bdata items of the bus
![Page 55: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/55.jpg)
1. Creating Process Data Variables
![Page 56: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/56.jpg)
2. Connecting Process DataItems with Global VariablesItems with Global Variables
via Drag & Dropvia Drag & Drop
via context menu
![Page 57: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/57.jpg)
Global Variableswith Process Data Connectionwith Process Data Connection
C tConnecteddd
CreatedCreated automatically
![Page 58: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/58.jpg)
Welcome to PHOENIX CONTACT
Data Management
Chapter 9Chapter 9
![Page 59: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/59.jpg)
Principle of Variable DeclarationDefinition 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: SyntaxPre initializing the variable: Syntax
![Page 60: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/60.jpg)
Welcome to PHOENIX CONTACT
Elementary Data yTypes in IEC 61131
![Page 61: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/61.jpg)
Hierarchy of Data Types
ANY_DATE STRING
ELEMENTARYANY_NUM TIMEANY_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
![Page 62: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/62.jpg)
Welcome to PHOENIX CONTACT
Constants - Literals
![Page 63: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/63.jpg)
Syntax of Constants
<Data type>#<Basis>#<Constant value><Unit>
BYTE#2#0011_1001 Constant of the01
Tetradseparator
type BYTE inbinary
representation
![Page 64: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/64.jpg)
Example for the Representationof Constantsof Constants
12 0 12 456 986I t t t #12456 -12 0 12_456 +986Integer constants
-12.0 0.0 0.456 +2.635e-12Real constants
Int#12456
Real#1.6e3
Word#12094Word constants Word#16#2F3
EWord#2#0010_1111_0011_11
10also
BYTE and DWORD
Bool constants Bool#1
Time#1 64 t#2d 14h 3 5
Bool#0 True False
Time constants Time#1.64s
t#2d_14h_3.5s
String constants String#‘Break?‘ ‘Right now, please!‘
![Page 65: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/65.jpg)
Welcome to PHOENIX CONTACT
Use of Variables
![Page 66: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/66.jpg)
Local Data
![Page 67: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/67.jpg)
Global Data
![Page 68: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/68.jpg)
Global VariablesLocal VariablesLocal Variables
POUvariable tables
Globalvariable tables
Localvariables
Interfacevariables
Globalvariables
Programinstance Project
- - - -VAR VAR_EXTERNAL_PG
VAR_EXTERNAL VAR_GLOBAL
VAR_GLOBAL_PG
VAR_INPUTVAR_OUTPUT VAR_EXTERNAL VAR_GLOBALVARVAR_IN_OUT
VAR_INPUT - - - -VAR
![Page 69: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/69.jpg)
Overview ofUse of VariablesUse of Variables
Program Functionblock
Functionblock
Globallyusedvariables
VAR_EXTERNALVAR_EXTERNAL_PG
VAR_EXTERNALVAR_EXTERNAL_PGVAR EXTERNAL FB
Localinterface
_ _
VAR_INPUTVAR OUTPUT
VAR_INPUT(o tp t declaredinterface
variables
Local
VAR_OUTPUTVAR_IN_OUT
(output declaredseparately)
VARVAR VARvariables VARVAR VAR
![Page 70: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/70.jpg)
Graphical Overview ofUse of VariablesUse of Variables
Program
FunctionBlock
GlobVarVAR INPUT
VAR_OUTPUT
LocVar
VARLocVar
InVar OutVar
_
LocVar
VAR_EXTERNA
Function
GlobVar
LLocVar
InVar
![Page 71: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/71.jpg)
Welcome to PHOENIX CONTACT
Managing Variablesg g
![Page 72: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/72.jpg)
Variable GroupsStandard
group
Edited:Groups forfunctionblocks
Edited:Groups forfunctionsfunctions
Edited:Groups forprograms
![Page 73: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/73.jpg)
Variable DialogAccess to local variable table Access to global
variable tableLocal variable table
Global variable table
![Page 74: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/74.jpg)
Welcome to PHOENIX CONTACT
Programming languages according to IEC 61131 3IEC 61131-3
Chapter 10Chapter 10
![Page 75: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/75.jpg)
The IEC 61131-3 LanguagesInstruction list Structured Text
Function block diagramFunction block diagramSequential functional chart
Ladder diagram
![Page 76: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/76.jpg)
Function Block Diagram (FBD)
• Graphical language, widely used in Europe• Programming elements in form of function blocksg 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.
BC
ANDAB
![Page 77: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/77.jpg)
Ladder Diagram (LD)
• Standardized limited set of programming• Standardized, limited set of programmingsymbols for relay control systems
• Based on the North-American programming style, similarto the US standard for drawing circuit diagramsto the US standard for drawing circuit diagrams
A B C--| |----| / |--------------( )--
![Page 78: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/78.jpg)
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
![Page 79: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/79.jpg)
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;
![Page 80: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/80.jpg)
Sequential Function Chart (SFC)
Step 1
• Powerful, graphical programming language for describing the sequence b h i f t l Action 1Step 1behavior 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
![Page 81: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/81.jpg)
Welcome to PHOENIX CONTACT
Programming in PC WORX
Chapter 11Chapter 11
![Page 82: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/82.jpg)
Welcome to PHOENIX CONTACT
Program gOrganization Units
![Page 83: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/83.jpg)
Inserting POUs
Project tree – ViewPOUs
Insertingposition inproject tree
Onlyavailable foravailable for
functions
![Page 84: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/84.jpg)
POU Properties
![Page 85: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/85.jpg)
POU Groups
![Page 86: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/86.jpg)
Welcome to PHOENIX CONTACT
Standard Functions
![Page 87: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/87.jpg)
Standard Functions 1
…_TO_... ANYANYData type conversion
F ti ithABS … 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 arithmeticfunctions
SHL…
ROL
ANY_BIT
ANY_INT
ANY_BITStandard bit shiftfunctions
AND…
XOR
ANY_BITANY_BIT
….
ANY_BIT
Bit-wise booleanfunctions
![Page 88: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/88.jpg)
Standard Functions 2
Selection functionsSEL…
ANYBOOL/ANY
….Selection functionsMUX
ANY
BOOLANY
Comparison functionsGT…NE
….
ANY
LEN…
FIND
ANY_BIT
ANY_INT
ANY_BITString functions
LEFT…
INSERT
ANY_DATE
ANY_DATE/ANY_INT
ANY_DATEString functions
![Page 89: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/89.jpg)
Welcome to PHOENIX CONTACT
Standard Function Blocks
![Page 90: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/90.jpg)
Standard Function Blocks 1
Fallingedge
Risingedge
Edge evaluationEdge evaluation
Bistable blocksBistable blocks (flipflops)
Primaryreset
Primarysetting
![Page 91: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/91.jpg)
Standard Function Blocks 2Counter countingup/down
Counter counting
down
Counter counting
up
Counter
Timers
Impulse Switch off Switch onImpulse encoder
Switch-offdelay
Switch-ondelay
![Page 92: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/92.jpg)
Welcome to PHOENIX CONTACT
FBD - Function Block Diagramm
Chapter 12Chapter 12
![Page 93: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/93.jpg)
Language Elements of Function Block DiagramFunction Block Diagram
FB callFB callFU call
FeedbackGreen:ProjectFB/FU
NegatioNegation
Blue:Library
DiagramDiagramin
FB/FUFB/FU FB/FUExecution
order
Red:Firmware FB/FUFirmware FB/FU
of IECYellow:FB/FU not
found
![Page 94: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/94.jpg)
Accessing Variables
F5Insertmark
Markedparameter
![Page 95: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/95.jpg)
Accessing Functions
![Page 96: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/96.jpg)
Accessing Function Blocks
Insertmark
![Page 97: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/97.jpg)
Editing Blocks
3
21
4
![Page 98: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/98.jpg)
Welcome to PHOENIX CONTACT
IL - Instruction List
Chapter 14Chapter 14
![Page 99: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/99.jpg)
Language Elementsin Instruction Listin Instruction List
Ld I xInput1Ld I_xInput1AndN I_xInput2Not St Q_xAccess1 Ld xPulse
St CTU_Access.CULd iM i l
Assignmentsand operators
Ld iMinLimit iBasis, iMaxSt iCorrected
Ld iMaximumvalueSt CTU_Access.PVLd xStopSt CTU_Access.RESET
FU callsand arguments FB calls
d t
Ld I_xInput1JmpC JumpFlag
Cal CTU_Access
Ld CTU_Access.QVSt iDisplayLd CTU Access Q
and arguments
J pC Ju p ag…RetJumpFlag:Ld I_xInput2St Q A 1
Ld CTU_Access.QSt xFullConditional
processing
St Q_xAccess1
![Page 100: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/100.jpg)
Assignment and Operators
Ld I I t1Loading an operand
Accumulator content
Ld I_xInput1
AndN I_xInput2
Loading an operandinto the accumulator
Linking the accumulator contentto the operand
E1
E1 * E2_
Or I_xInput3
pE1 * E2
E1 * E2 + E3
Linking the accumulator contentto the operand
St Q_xOutput1E1 * E2 + E3
Saving the accumulator contenton the target operand
![Page 101: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/101.jpg)
Operators in Instruction List
LD
ANY ANY_NUM ANY_BIT
LDST
Load
SaveANDORXOR
And
Or
Exclusive Or
ADDSUBMUL
Addition
Subtraction
Multiplication
GT Greater than
XORNOT
Exclusive Or
Complement
MULDIV
Multiplication
DivisionANY_NUM and ANY_BIT
GEEQNE
Greater or equal
Equal
Not equal S SetJMPRET
JumpBOOL
NELELT
Not equal
Less or equal
Less than
SR Reset
RETCAL)
Return
FB call
![Page 102: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/102.jpg)
Modifying the Operators
LdN I xInput1 E1 * E2 = E1 + E2LdN I_xInput1AndN I_xInput2And( I_xInput3NotOr I_xInput4)St Q_xOutput1
![Page 103: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/103.jpg)
Function Calls
1. Operand explicitely loaded
Ld iMinLimit iQuantity, iMaxSt iCorrectionSt iCorrection
Ld wMinWord_To_Int
accumulator
1. Operand from the
accumulator_ _
Limit iQuantity, iMaxSt iCorrection
![Page 104: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/104.jpg)
Editing in PC WORXInserting via the edit wizard
Comments asdummies
LD (* IN as ANY_BIT *)ROR (* N as ANY_INT *)ST (* Result as ANY BIT *) P tST (* Result as ANY_BIT *)
y
Parameter name and
data typeAfter editing by user
Ld wRawsizeRoR INT#8RoR INT#8St wRotates
![Page 105: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/105.jpg)
Function Block Calls
Ld I_xInput1 Data import_St TON_Signal.INLd tDelayLd tDelaySt TON_Signal.PT
Calculation
Cal TON_Signal
Ld TON_Signal.QSt Q_xOutput1Ld
Data export
Ld TON_Signal.ETSt tSequence
![Page 106: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/106.jpg)
Editing in PC WORXInserting
via theedit
wizarda dDeclaration
dialog
LD xActivate
After editing
LD (* BOOL *)ST TON_1.INLD (* TIME *)ST TON_1.PT
LD xActivateST TON_1.INLD TIME#250msST TON_1.PT
by the user
_CAL TON_1LD TON_1.QST (* BOOL *)LD TON_1.ET
CAL TON_1
LD TON_1.QST xDelayed_
ST (* TIME *)ST xDelayedLD TON_1.ETST tSequence
![Page 107: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/107.jpg)
Conditional Code ExecutionJMP | RETJ |
Ld iRawsize
Skip markerGT iMaxJmpC TooGreatLd iRawsize
Conditional jump
Ld iRawsizeLT iMinJmpC TooSmallR t
Skip markerAbsolutefunction block Ret
TooGreat: Ld iMax
end
St iRawsizeRet
TooSmall: Ld iMinTooSmall: Ld iMinSt iRawsize
![Page 108: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/108.jpg)
Welcome to PHOENIX CONTACT
LD - Ladder Diagram
Chapter 15Chapter 15
![Page 109: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/109.jpg)
Welcome to PHOENIX CONTACT
Basic Elements
![Page 110: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/110.jpg)
Editing in Ladder Diagram
s
Insert element
s
Switch-through options
Contact options
Coil optionsCoil options
![Page 111: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/111.jpg)
Contact / Coil Dialog
Additional
g
Additional options
compared tovariable dialog
![Page 112: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/112.jpg)
Functions and Function Blocksin Ladder Diagramin Ladder Diagram
FunctionFunctionsVariables blocksFunctionsVariables
![Page 113: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/113.jpg)
Formatting the Ladder Diagram
Arrange leftpower rails
Arrange power railspower rails rails
![Page 114: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/114.jpg)
Welcome to PHOENIX CONTACT
SFC - Sequential Function Chart
Chapter 16Chapter 16
![Page 115: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/115.jpg)
Welcome to PHOENIX CONTACT
Basic Structure of the Sequential Function Chart
![Page 116: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/116.jpg)
Sequential Function Chart POU in the Project Treein the Project Tree
POU
Transitionfolder
POUbase element
Action
Transition
in ILActionfolder
Transition
in LD
Action in FBD
![Page 117: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/117.jpg)
Basic StructureInserting the
basic structure/
further steps
Step
Feedback
Action block
Transition
![Page 118: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/118.jpg)
Welcome to PHOENIX CONTACT
Basic Elements
![Page 119: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/119.jpg)
The Step
Standard step
Step flag
End stepJumpInitial step
![Page 120: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/120.jpg)
The TransitionDirect Connection
Elements fromLD and FBD
Transition asdirect connectiondirect connection
![Page 121: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/121.jpg)
The TransitionTransition detail
TransitionTransition as detail
Transition name as variable name
![Page 122: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/122.jpg)
The Action Block
Inserting/AddingInserting/Addingan action block
Action blockas action detail
Action blockas booleanparameter
Actionqualifier
![Page 123: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/123.jpg)
Action Variable
![Page 124: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/124.jpg)
Action Detail
![Page 125: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/125.jpg)
Branches
Parellel/simultaneousParellel/simultaneous AlternativeParellel/simultaneousParellel/simultaneousbranch
Alternativebranch
![Page 126: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/126.jpg)
Inserting Branches Later On
1
2
3 4
![Page 127: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/127.jpg)
Welcome to PHOENIX CONTACT
User-Defined Data Types
Chapter 17Chapter 17
![Page 128: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/128.jpg)
Worksheets forUser-Defined Data TypesUser Defined Data Types
![Page 129: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/129.jpg)
Welcome to PHOENIX CONTACT
Fields
![Page 130: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/130.jpg)
Principle
WORDWORD
WORD
AR_1_4_WWORD
WORD
Name exampleName example
AR_<LowerBound>_<UpperBound>_<BasicType>
![Page 131: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/131.jpg)
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
basedon
AR_1_8_1_4_W : Array [1..8] Of AR_1_4_W;End_TypeTwo-dimensional
array
![Page 132: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/132.jpg)
Use in Programming
Assigning two array variablesof the same dimensions
arVariable1 := arVariable2;
A i i i l lAssigning a single valueto an element of an
array variable using a constant
Assigning a single valueAssigning a single valueto an element of an
array varable using an index variableLd wVariableSt arVariable[iIndex]
![Page 133: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/133.jpg)
Welcome to PHOENIX CONTACT
Structures
![Page 134: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/134.jpg)
Principle
REALREAL
INT
ST_PumpINT
BOOL
Name exampleName example
ST_<Function>
![Page 135: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/135.jpg)
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
TypeTypeST_Pump : Struct
rEngineCurrent : Real;iFlow : Int;iMediaTemperature : Int;xBroken : Bool;
End_Struct; End_Type
![Page 136: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/136.jpg)
Use in Programming
Assigning two structure variablesof the same dimensionstP 12 tP 13stPump12 := stPump13;
Assigning a single valueto an element of a structure
variable using named parameters
![Page 137: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/137.jpg)
Welcome to PHOENIX CONTACT
Combined User-Defined Data Types
![Page 138: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/138.jpg)
Declaration and Use
TypeST_Pump : Struct
rMotorCurrent : Real;Structure iFlow : Int;iMedTemperature : Int;xBroken : Bool;
End_Struct;
Structuredeclaration
_
AR_1_20_Pump : Array [1..20] Of ST_Pump;End_Type
Arraydeclaration
![Page 139: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/139.jpg)
Use in Programming
array variables of the same dimensionAssigning two complex
array variables of the same dimension
A i i t t i blAssigning a structure variableto an array element of a complex array variable
Assigning a single value
arPumppark[12] := stPump12;
Assigning a single valueto an element of a
complex array variableLd iFlow_Pump12_St arPumppark[12].iFlow
![Page 140: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/140.jpg)
Welcome to PHOENIX CONTACT
ST - Structured Text
Chapter 18Chapter 18
![Page 141: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/141.jpg)
Language Elementsof Structured Textof Structured Text
Q_xAccess1 := False;Q xAccess2 := I xInput2 & Not I xInput4;Assignments, operators Q_ _ p _ p ;
If I_xInput1 & I_xInput2 ThenQ_xAccess1 := True;
ElsIf I_xAccess2 & I_xAccess3 ThenQ xAccess2 : True;
RequestsQ_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;
RepeatiLoop := iLoop + 1;
Loops Until iLoop = 100End_Repeat;
Loops
![Page 142: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/142.jpg)
Assignments and OperatorsAssignment
operator
Q xOutput1 := I xInput1 & Not I xInput2
1122
Q_ p _ p _ pOr I_xInput3;
Assignment directionAssignment direction
11 22
Assignment direction
11 22
Calculation11
22 Assignment
![Page 143: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/143.jpg)
Operator HierarchyOperation
Function(Arguments)
(Expression)
Function evaluation
Brackets
SymbolANY
*
Data typegroup
Function(Arguments)Function evaluation
iNumber1 ** iNumber2Potentialization
NegationComplement
-iNumberNOT wCode
NUM
BIT
*
MultiplicationDivisionModulo
iNumber1 * iNumber2rNumber1 / rNumber2
iNumber1 MOD iNumber2
Addition iNumber1 + iNumber2rity NUM
*
**
AdditionSubtraction
iNumber1 + iNumber2rNumber1 - rNumber2
Comparison diA > diB wC < wD iE >= iF
Equality iNumber1 = iNumber2b 1 b 2
Prio
iG <= iH
ANY
*
**Inequality rNumber1 <> rNumber2
xVar1 XOR xVar2Boolean exclusive OR
Boolean AND xVar1 & xVar2wCode1 AND wCode2
BIT
*
bVar1 OR bVar2
a O a
Boolean OR
Boolean exclusive OR
![Page 144: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/144.jpg)
Function Calls
iCorrection := Limit(iMin,iMeasuredvalue,iMax);
Functionname
Functionarguments
iCorrection := Limit(iMin,Word To Int(wRawsize),Word_To_Int(wRawsize),iMax);
Return value of 1st function as argument for 2nd function
![Page 145: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/145.jpg)
Editing in PC WORXInserting via the edit wizard
Parameter name Comments as
data typeand
data type
Comments asdummies
(* Result as ANY_BIT *) := ROR((* IN as ANY_BIT *),(* N as ANY_INT *));
After editing by the user
wRotates := RoR(wRawsize, INT#8);
![Page 146: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/146.jpg)
Function Block Calls
TON_Signal(IN := I_xInput,PT := tDelay);
Data importand calculation
Q_xOutput := TON_Signal.Q;tSequence := TON Signal ET;
Data export
tSequence : TON_Signal.ET;
Alternativecall
TON_Signal.IN := I_xInput,;TON Signal.PT := tDelay;_ g y
TON_Signal();
Q xOutput := TON Signal.Q;Q_ p _ g QtSequence := TON_Signal.ET;
![Page 147: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/147.jpg)
Editing in PC WORXInserting
via theedit
wizardD l tiDeclaration
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;
![Page 148: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/148.jpg)
FU Call and FB Call in Comparison
Assignment viafunction
Assignmentvia order
iCorrection := Limit(iMin,iMeasuredvalue,FUiMax);
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 itSequence := TON_Signal.ET;
Assignment via
Assignment via named formal
parameters
Assignment viaoutput Parameters
![Page 149: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/149.jpg)
Welcome to PHOENIX CONTACT
High-Level gLanguage Elements 1Th R tThe Requests
![Page 150: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/150.jpg)
IfOpeningkeyword
If (* Boolean condition *) Then
(* Instructions *)
End If;End_If;
Closing
Instructions are only processed by the control
t if diti i tClosingkeyword
system if condition is met
![Page 151: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/151.jpg)
If Extensions
If I_xSensor1 & Not I_xSensor2 Then _ _(* Instructions 1 *)
ElsIf I_xSensor2 & Not I_xSensor1Then
Repeatedlyoptional
Then (* Instructions 2 *)
ElseIf iM d l < 100 Th
One-time
optionalIf iMeasuredvalue < 100 Then
(* Instructions 3 *)ElsIf iMeasuredvalue > 100 Then
Nestedcondition
(* Instructions 4 *)End_If;
End If;End_If;
![Page 152: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/152.jpg)
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;
![Page 153: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/153.jpg)
CaseUse 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
![Page 154: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/154.jpg)
CaseUse 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;
![Page 155: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/155.jpg)
Welcome to PHOENIX CONTACT
High-Level gLanguage Elements 2Th LThe Loops
![Page 156: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/156.jpg)
For
Loop variable
Startvalue
Endvalue
Width of stepoptional
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 ThenarrMachine[iIndex].iBroken := True;xAlarm := True;Exit;
End_If;
End For;
20
Early abortion of
loop executiond_ o ;
![Page 157: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/157.jpg)
Repeat | While
Head-controlled
“Repeat … until …”
Repeat iIndex := iIndex +
10;
0
While
controlled
;
UntiliIndex >= iLimit
eiIndex >= iLimit
DoiI d iI d +
End_Repeat;?
Foot-controlled
iIndex := iIndex + 10;
End While;controlled
_
“As long as …, do …”
![Page 158: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/158.jpg)
Welcome to PHOENIX CONTACT
Project Management
Appendix A1Appendix A1
![Page 159: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/159.jpg)
Welcome to PHOENIX CONTACT
Project Filesj
![Page 160: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/160.jpg)
Saving... / ArchivingSave as ... Archiving
![Page 161: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/161.jpg)
Welcome to PHOENIX CONTACT
CPU Control Dialogg
![Page 162: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/162.jpg)
CPU Selection
![Page 163: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/163.jpg)
Temporary Project - Bootproject
![Page 164: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/164.jpg)
Welcome to PHOENIX CONTACT
Project Codesj
![Page 165: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/165.jpg)
Memory Concept
Download bootproject
Download project
Reset
Archiving project via
FTP server
Compiledmachine code
Decodablesource code
![Page 166: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/166.jpg)
Standard Archive
ZipFile.zwt
![Page 167: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/167.jpg)
Welcome to PHOENIX CONTACT
Libraries
Appendix A2Appendix A2
![Page 168: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/168.jpg)
Library Directory
![Page 169: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/169.jpg)
Welcome to PHOENIX CONTACT
Creating Librariesg
![Page 170: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/170.jpg)
Saving
![Page 171: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/171.jpg)
Removal and Compilation
![Page 172: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/172.jpg)
Welcome to PHOENIX CONTACT
Using Librariesg
![Page 173: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/173.jpg)
Including User Libraries
![Page 174: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/174.jpg)
Including Firmware Libraries
![Page 175: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/175.jpg)
The Library in a User Project
![Page 176: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/176.jpg)
Using Projects With LibrariesWith Libraries
Uncompiled library
![Page 177: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/177.jpg)
Help on Firmware Libraries
![Page 178: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/178.jpg)
Welcome to PHOENIX CONTACT
Testing & Debugging
Appendix A3Appendix A3
![Page 179: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/179.jpg)
Status in Worksheets
![Page 180: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/180.jpg)
Overwriting/Forcing
![Page 181: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/181.jpg)
Powerflow (via Address Status)
Graphicpowerflow
Textualpowerflow
![Page 182: PCWorx Detail](https://reader036.vdocuments.us/reader036/viewer/2022082208/55cf970a550346d0338f6ea2/html5/thumbnails/182.jpg)
Information on Mouse PointerTooltipsTooltips