Schutzvermerk nach DIN 34 beachten 16. März 2022 Seite 2 XSoft Agenda 5 6 7 8 9 10 1 2 3 4 Programming with Moeller XSoft IEC-Basics and basic logic circuits The elementary data types Derived Data Types Application structure and variable scope POU composition Standard libraries and their use Continuous Function Chart Management of global variables in XSoft Structured Text
122
Embed
Schutzvermerk nach DIN 34 beachten 19/07/15 Seite 1 XSoft.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 2
XSoft
Agenda
5
6
7
8
9
10
1
2
3
4
Programming with Moeller XSoft
IEC-Basics and basic logic circuits
The elementary data types
Derived Data Types
Application structure and variable scope
POU composition
Standard libraries and their use
Continuous Function Chart
Management of global variables in XSoft
Structured Text
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 3
XSoft
Agenda
15
16
17
18
19
20
11
12
13
14
Task management in the XSoft
Test and Commissioning
Address structure according to IEC 61131-3
Erzeugen einer Symboldatei
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 4
XSoft
Programming with Moeller XSoft
Programming with Moeller XSoftProgramming with Moeller XSoft
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 5
XSoft
Develop efficiently with XSoft
Two parts:
• Programming according to the international standard IEC 61131-3
• Learning about the XSoft features
• Using the programming features and benefits for the hardware of the XSystem
Objective of the workshop
Programming with Moeller XSoftProgramming with Moeller XSoft
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 6
XSoft
Moeller Automation
Sys
tem
PS
40
XS
yste
m
MI4 MV4 XI/ON WINbloc
IEC61131-3
DFx/DVx MotionXI/OC
Scope of application
Programming with Moeller XSoftProgramming with Moeller XSoft
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 7
XSoft
XVision
XControlXMotion
XSoft
XSoft:
Programming with Moeller XSoftProgramming with Moeller XSoft
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 8
XSoft
Programming languages: IL, ST, LD, FBD, SFC
and CFC
Integrated fieldbusconfigurators für CAN, DP, XI/ON, XIO
Extensive libraries
Online functions (Online- change, Insertion of new variables, Tracing etc.)
Integrated visualization for XVision
XSoft: Summary
Programming with Moeller XSoftProgramming with Moeller XSoft
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 9
XSoft
IEC-Basics and basic logic circuits
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 10
XSoft
1. General information2. Equipment requirements and tests
3. Programming languages
4. User guidelines5. Messaging service specification6. (not used)
7. Fuzzy
IEC EN 61131 Overview
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 11
XSoft
IEC 61131-3
• How data is declared• the structure of an application• the syntax and the semantics of five different
programming languages
The international standard defines:
XSoft is an IEC 61131-3 programming system!
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 12
XSoft
• Supplier independent programming
• Reduction of software investment thanks to re-usable function blocks
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 13
XSoft
Overview of the programming languages
Automation project
LD / FBDIL
ST
SFC
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 14
XSoft
Label
END: LD % IX0.0or
Motor1_ON
Comment
(* Feeder raw parts *)
Director
Symbolic
IL - the programming line structure in instruction list
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 15
XSoft
JMP JMPC JMPCNJump/Branch Operators
& &N AND ANDN OR ORN XOR XORNLogic Operators
ADD DIV MUL SUBArithmet. Operators
CAL CALC CALCN RET RETC RETCNCalls & Returns
EQ GE GT LE LT NEComparators
LD LDN ST STN S R Assignmentoperators
Operators
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 16
XSoft
Variable names must not contain national symbols (ä, ü, ö), blanks or hyphens !
Variable names must not begin with a number !
Variable names and file (program) namesMUST differ !
Keywords must not be used as variable names !
Sample: A variable named LT (e.g. for the function „lamp test“) will lead to an error messagebecause LT is the reserved keyword for a comparator ! (LT=Less Than)
Stör-M1:BOOL Stoer_M1:BOOL
1_Start:BOOL Start_1:BOOL
Pump:BOOL Pump1:BOOLPump.POE Pump.POE
LT:BOOL L_Test:BOOL
Hints for the use of identifiers
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 17
XSoft
Chose your variable name in a way that they are self-explanatory.Use a capital letter as the first letter and use small letter for the rest.
Separate variable names consisting of several word by underscores between the words and start each word with a capital letter.
When working with brackets please use indentions for each level.e.g. use one TAB for each new bracket level.
Always put jump labels in a separate line and highlight them by e.g.framing them with comments
All below mentioned hints serve the purpose of making your programs easy to readand give them a well-defined structure:
Hints for the creation of programs
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 18
XSoft
&
&
>=
>=
Result LD AND OR ( AND ( OR ) )ST Result
LD (
....................
LD
LD
AND
ST
LD
AND ( ( .......
......................
AND )
...........
1Value
Value2
Value3
Value4
Value5
1ValueValue2
Value3Value4
Value5
1Value
Value2X....
1ValueX1Value
X Value5X
Working with brackets
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 19
XSoft
Standard operators
Programming in LD (Ladder diagram)
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 20
XSoft
Storing within networks
Direct support via menu bar
Enable networks at
FB inputs
Specialities in the LD / FBD editors
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 21
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 22
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 23
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 24
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 25
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 26
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 27
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 28
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 29
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 30
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 31
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 32
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 33
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 34
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 35
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 36
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 37
XSoft
Information : Schedule for programming
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 38
XSoft
Exercise: IEC basics and basic circuits
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 39
XSoft
Exercise: IEC basics and basic circuits
IEC-Basics and basic logic circuitsIEC-Basics and basic logic circuits
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 40
XSoft
The elementary data types
• BOOL• BYTE, WORD, DWORD • SINT, INT, DINT• USINT, UINT, UDINT• REAL, LREAL • STRING• TIME, TOD, DATE, DT
The elementary data typesThe elementary data types
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 41
XSoft
Data types - Interpretation of values
Elementary data types
The elementary data typesThe elementary data types
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 42
XSoft
0100 00010100 0001
0100 0001 SINT0100 0001 SINT
41 Hex
Input 1 und 7 high
2 + 2 = 650 6
2 + 2 = 650 6
Now it‘sclear !
Now it‘sclear !
What doesit mean ?
What doesit mean ?
IEC Programming languagesWhy data types ?
The elementary data typesThe elementary data types
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 43
XSoft
Bool Byte
Word DWord
REALANY_INT
ANY Bit
Maths Town
ADD DIV SUBMUL
ANYNUM Bit City
AND OR XOR
Type specific use
The elementary data typesThe elementary data types
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 44
XSoft
Information: Elementary data types
The elementary data typesThe elementary data types
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 45
XSoft
Information: Elementary data types
The elementary data typesThe elementary data types
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 46
XSoft
Information: Elementary data types
The elementary data typesThe elementary data types
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 47
XSoft
Derived Data Types
Derived Data Types
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 48
XSoft
Value limitations Rotations : UINT(250..3500);
Enumerations tDialmode : (TONE, PULSE);
Arrays
Structures
values : ARRAY[1..10] OF INT;
Oven_data :STRUCT Temperature : REAL; Time : DT;END_STRUCT
VAR M_Tact : Timegenerator; Start AT%I0.0: BOOL; Tact AT%Q0.0: BOOL;END_VAR
VAR M_Tact : Timegenerator; Start AT%I0.0: BOOL; Tact AT%Q0.0: BOOL;END_VAR
1. VariantIEC compliant
2. VariantIEC compliant
3. Variant(XSoft;next version ofIEC 61131-3)
CAL M_Tact (Set:=Start, Period:=20, PulseOutput=>Tact
)
CAL M_Tact (Set:=Start, Period:=20, PulseOutput=>Tact
)
POU composition
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 64
XSoft
Standard libraries and their use
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 65
XSoft
Power
machine
x
o
stationnumber
alarm
IEC61131-3
Standard libraries
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 66
XSoft
Additional libraries
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 67
XSoft
Exercise: Delayed activation
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 68
XSoft
Solution: Delayed activation
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 69
XSoft
: Toiletten-Licht-Lüfter-SteuerungExercise: Toilet control
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 70
XSoft
Solution: Toilet control
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 71
XSoft
Exercise: Toilet control; extension
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 72
XSoft
Solution: Toilet control; extension
Standard libraries and their use
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 73
XSoft
Continuous Function Chart
Continuous Function Chart
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 74
XSoft
Continuous Function Chart (CFC)
• Graphical Programming language• Not within the scope of the standard IEC 61131-3• useful “enhancement” of FBD• Of all the programming languages best suitable for the
programming of complex expressions with feedback loops (therefore widely spread in the process industry)
Continuous Function Chart
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 75
XSoft
InputOutput
Block
Jump
Label
Return
Comment
NegateSet/Reset
Enable
Create Macro
In-PinOut-Pin
Operators
Continuous Function Chart
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 76
XSoft
Execution rules
Continuous Function Chart
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 77
XSoft
Macros
Create macro
Continuous Function Chart
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 78
XSoft
Exercise: Function block blinker
Continuous Function Chart
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 79
XSoft
Solution: Function block blinker
Continuous Function Chart
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 80
XSoft
Management of global variables in XSoft
Management of global variables in XSoft
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 81
XSoft
Generelly accessible variables(Global variables)
Global Variables I
Management of global variables in XSoft
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 82
XSoft
Eintrag über die Eingabehilfeder automatischen Deklaration
Auswahl der gewünschtenglobalen Variablenliste
Global Variables II
Management of global variables in XSoft
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 83
XSoft
Structured Text
Structured TextStructured Text
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 84
XSoft
Structured Text
• Textual language• High level language• similar to PASCAL or C• not so well known in the PLC/automation world• of all languages best suitable for programming loops and
branches/decisions
Structured TextStructured Text
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 85
XSoft
Analog Operators
IL,FBD,LD ST• ADD +• SUB -• MUL *• DIV /
Working with ANY_NUM, TIME
Structured TextStructured Text
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 86
XSoft
Comparison Operators
IL,FBD,LD ST• EQ =• NE <>• GE >=• GT >• LE <=• LT <
Working with ANY data type
Structured TextStructured Text
Sch
utz
verm
erk
na
ch D
IN 3
4 b
eac
hte
n
19. April 2023 Seite 87
XSoft
Hierarchy of the operators
IL
LD I1AND I2OR (I3AND I4
)ST result
ST
result:= I1 AND I2 OR I3 AND I4;
result:= (I1 AND I2) OR (I3 AND I4);result:= (I1 AND I2) OR (I3 AND I4);