Download presentation
Presentation is loading. Please wait.
Published bySydni Pallas Modified over 10 years ago
1
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 1 XSoft
2
Schutzvermerk nach DIN 34 beachten 20/04/15 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
3
Schutzvermerk nach DIN 34 beachten 20/04/15 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
4
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 4 XSoft Programming with Moeller XSoft
5
Schutzvermerk nach DIN 34 beachten 20/04/15 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 XSoft
6
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 6 XSoft Moeller Automation System PS40 XSystem MI4MV4XI/ONWINbloc IEC 61131-3 DFx/DVxMotionXI/OC Scope of application Programming with Moeller XSoft
7
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 7 XSoft XVision XControl XMotion XSoft XSoft: Programming with Moeller XSoft
8
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 8 XSoft Programming languages: IL, ST, LD, FBD, SFC and CFC Integrated fieldbus configurators 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 XSoft
9
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 9 XSoft IEC-Basics and basic logic circuits
10
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 10 XSoft 1. General information 2. Equipment requirements and tests 3. Programming languages 4. User guidelines 5. Messaging service specification 6. (not used) 7. Fuzzy IEC EN 61131 Overview IEC-Basics and basic logic circuits
11
Schutzvermerk nach DIN 34 beachten 20/04/15 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 circuits
12
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 12 XSoft Supplier independent programming Reduction of software investment thanks to re-usable function blocks Reduced training effort Arguments for IEC systems IEC-Basics and basic logic circuits
13
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 13 XSoft Overview of the programming languages Automation project LD / FBD IL ST SFC IEC-Basics and basic logic circuits
14
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 14 XSoft Label END:LD% IX0.0 or Motor1_ON Comment (* Feeder raw parts *) Direct or Symbolic IL - the programming line structure in instruction list IEC-Basics and basic logic circuits
15
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 15 XSoft JMP JMPC JMPCN Jump/Branch Operators & &N AND ANDN OR ORN XOR XORN Logic Operators ADD DIV MUL SUB Arithmet. Operators CAL CALC CALCN RET RETC RETCN Calls & Returns EQ GE GT LE LT NE Comparators LD LDN ST STN S R Assignment operators Operators IEC-Basics and basic logic circuits
16
Schutzvermerk nach DIN 34 beachten 20/04/15 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) names MUST 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 message because 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:BOOL Pump.POE LT:BOOL L_Test:BOOL Hints for the use of identifiers IEC-Basics and basic logic circuits
17
Schutzvermerk nach DIN 34 beachten 20/04/15 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 read and give them a well-defined structure: Hints for the creation of programs IEC-Basics and basic logic circuits
18
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 18 XSoft & & > = > = Result LD AND OR ( AND ( OR ) ) ST Result LD (.................... LD LD AND ST LD AND ( (............................. AND )........... 1 Value Value2 Value3 Value4 Value5 1 Value Value2 Value3 Value4 Value5 1 Value Value2 X.... 1 Value X 1 X Value5 X Working with brackets IEC-Basics and basic logic circuits
19
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 19 XSoft Standard operators Programming in LD (Ladder diagram) IEC-Basics and basic logic circuits
20
Schutzvermerk nach DIN 34 beachten 20/04/15 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 circuits
21
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 21 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 types
22
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 22 XSoft Data types - Interpretation of values Elementary data types The elementary data types
23
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 23 XSoft 0100 0001 0100 0001 SINT 41 Hex Input 1 und 7 high 2 + 2 = 65 06 06 Now it‘s clear ! Now it‘s clear ! What does it mean ? What does it mean ? IEC Programming languages Why data types ? The elementary data types
24
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 24 XSoft Bool Byte WordDWord REAL ANY_INT ANY Bit Maths Town ADD DIV SUB MUL ANY NUM Bit City AND OR XOR Type specific use The elementary data types
25
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 25 XSoft Derived Data Types
26
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 26 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 IEC 61131-3 Derived data types Derived Data Types
27
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 27 XSoft Data:Array[1..10] of INT; 1 2 3 4 5 6 7 8 9 10 Data[5]... :Array[1..10,1..4,1..3] of INT; 1 3 1234 2 2 3 1 4 5 6 7 8 9 10 Data[5,4,2]... :Array[1..10,1..4] of INT; 1 1234 2 3 4 5 6 7 8 9 10 Data[7,4] ARRAYs Derived Data Types
28
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 28 XSoft 1 2 3 4 Datenfelder – ARRAYs – vierdimensional ?! Derived Data Types
29
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 29 XSoft Temperature :125 °C Time : 2002-04-11-15:35:47 Heat_time : 7m Alarm : 0 Oven1.Temperature Oven1.Time Oven1.Heat_time Oven1.Alarm Oven_data : STRUCT Temperature : UINT ; Time : DT ; Heat_time : TIME ; Alarm : BOOL ; END_STRUCT ; TYPE END_TYPE VAR Oven1 : Oven_data ; END_VAR Derived Data Types - Structures - Derived Data Types
30
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 30 XSoft Application structure and variable scope
31
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 31 XSoft Project BlocksGlobal VariablesData types DeclarationCode Structure of an application software Application structure and variable scope
32
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 32 XSoft PROGRAM „PLC_PRG“ FU FB FU FB Function block Function ax² + b = y Result in Akku Program LD AND ST IN OUT IN PROGRAM FU FB FU FB PROGRAM FB FU FB POU Types Application structure and variable scope
33
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 33 XSoft FU FB FU FB PROGRAM PROGRAM (e.g. in IL) Action (CFC) Action (ST) Action (LD) Action (CFC) Actions Application structure and variable scope
34
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 34 XSoft LocalGlobalType InputOutputInOutExternal Pump Scope of variables (1) Application structure and variable scope
35
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 35 XSoft LocalGlobalType InputOutputInOutExternal Global Pump External Pump Valid area Scope of variables (2) Application structure and variable scope
36
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 36 XSoft LocalGlobalType InputOutputInOutExternal Valid area Input Druck Input Druck Output Pump InOut Mit Scope of variables (3) Application structure and variable scope
37
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 37 XSoft POU composition
38
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 38 XSoft Program Organiation Unit DeclarationsInstructions + VAR Input1 AT %I0.0.0.0.0 : BOOL ; Output1 AT %Q0.0.0.0.0 : BOOL ; END_VAR LDInput1 STOutput1 Composition of a POU POU composition
39
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 39 XSoft Instanciation means: Assignment of a data set to a function block or a variable VAR parts_counter : CTU; END_VAR CTU Instructions CTU Instructions + Parts_counter Data Parts_counter Data PLC‘s memory Instanciation (1) POU composition
40
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 40 XSoft Multiple instanciation means: Assignment of several data sets to a function block VAR raw_parts : CTU; finished_parts : CTU; waste : CTU; END_VAR CTU Instructions CTU Instructions + Data set raw_parts Data set raw_parts Xcontrol memory Data set finished_parts Data set finished_parts Data set waste Data set waste Instanciation (2) POU composition
41
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 41 XSoft Call-up of function blocks Time Generator Set Period Pulse Output BOOL PROTOTYPE Instructions CAL M_Tact (Set:=Start, Period:=20 ) LD M_Tact.PulseOutput ST Tact CAL M_Tact (Set:=Start, Period:=20 ) LD M_Tact.PulseOutput ST Tact LD Start ST M_Tact.Set LD 20 ST M_Tact.Period CAL M_Tact LD M_Tact.PulseOutput ST Tact LD Start ST M_Tact.Set LD 20 ST M_Tact.Period CAL M_Tact LD M_Tact.PulseOutput ST Tact PROGRAM Timertest Declaration 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. Variant IEC compliant 2. Variant IEC compliant 3. Variant (XSoft; next version of IEC 61131-3) CAL M_Tact (Set:=Start, Period:=20, PulseOutput=>Tact ) CAL M_Tact (Set:=Start, Period:=20, PulseOutput=>Tact ) POU composition
42
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 42 XSoft Standard libraries and their use
43
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 43 XSoft Power machine x o station number alarm IEC 61131-3 Standard libraries Standard libraries and their use
44
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 44 XSoft Additional libraries Standard libraries and their use
45
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 45 XSoft Continuous Function Chart
46
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 46 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
47
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 47 XSoft Input Output Block Jump Label Return Comment Negate Set/Reset Enable Create Macro In-Pin Out-Pin Operators Continuous Function Chart
48
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 48 XSoft Execution rules Continuous Function Chart
49
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 49 XSoft Macros Create macro Continuous Function Chart
50
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 50 XSoft Management of global variables in XSoft
51
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 51 XSoft Generelly accessible variables (Global variables) Global Variables I Management of global variables in XSoft
52
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 52 XSoft Eintrag über die Eingabehilfe der automatischen Deklaration Auswahl der gewünschten globalen Variablenliste Global Variables II Management of global variables in XSoft
53
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 53 XSoft Structured Text
54
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 54 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 Text
55
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 55 XSoft Analog Operators IL,FBD,LDST ADD + SUB - MUL * DIV / Working with ANY_NUM, TIME Structured Text
56
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 56 XSoft Comparison Operators IL,FBD,LDST EQ = NE<> GE>= GT > LE<= LT < Working with ANY data type Structured Text
57
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 57 XSoft Hierarchy of the operators IL LDI1 AND I2 OR(I3 ANDI4 ) STresult ST result:= I1 AND I2 OR I3 AND I4; result:= (I1 AND I2) OR (I3 AND I4); Structured Text
58
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 58 XSoft Branching I LDvariable GT100 JMPC greater LDvariable EQ100 JMPC equal LDa ADD1 STa JMPEND greater: LDa SUB1 STa JMPEND equal: LDa STresult END: IL IF variable > 100 THEN a:=a-1; ELSIF variable = 100 THEN result:=a; ELSE a:=a+1; END_IF; ST Structured Text
59
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 59 XSoft Branching II LDvariable EQ1 JMPC case_1 LDvariable EQ2 OR(variable EQ3 ) OR(variable EQ4 ) JMPC case_2 LDa ADD1 STa JMPEND case_1: LDa ADD1 STa JMPEND case_2:. IL CASE variable OF 1: a:=a+1; 2,3,4: a:=a+2; 5..100: a:=a+3; ELSE a:=0; END_CASE; ST Structured Text
60
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 60 XSoft Loops I FOR variable := 1 TO 10 DO STEP 1 array_a[variable]:=100; array_b[variable]:=50; array_c[variable]:=3; END_FOR; FOR VAR array_a:ARRAY[1..10] OF INT; array_b:ARRAY[1..10] OF UINT; array_c:ARRAY[1..10] OF USINT; END_VAR Structured Text
61
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 61 XSoft WHILE a <= 100 DO a:=a*2; b:=b+1; c:=c+5; END_WHILE; WHILE DO REPEAT a:=a+1; b:=b*2; UNTIL a=100 OR b=50 END_REPEAT; REPEAT UNTIL The cycle time trap Loops II Structured Text
62
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 62 XSoft Task management in the XSoft
63
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 63 XSoft Task Definition Task1 20ms Prg1 Prg2Prg3 Task2 event Prg4 Prg5 In XSoft there exist two kinds of tasks „Periodic“ and „Event triggered“. For the execution the following rules are valid:.The task, for which the condition is fulfilled, will be executed, i.e. if the time period has elapsed or on the rising edge of the associated global triggering event. ·If several task have valid conditions at the same moment the task with the highest priority will be executed first. ·If several tasks have valid conditions and the same priority the task with the longest waiting time will be executed. Task management in the XSoft
64
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 64 XSoft Task Definition Xsoft Task Interval Execution priority Event triggered task with global trigger variable Task management in the XSoft
65
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 65 XSoft Project Task 1 Task 2 Task 9...... Program 1 Program 2 Program 3 Program N Definition of hierarchies Task management in the XSoft
66
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 66 XSoft Cyclic Event triggered e.g. by global variable S1= 1 TaskA Prog1 H1:=NOT H1 TaskA Prog1 H1:=NOT H1 TaskA Prog1 H1:=NOT H1 H1:=1H1:=0H1:=1 1s TaskA Prog1 H1:=NOT H1 TaskA Prog1 H1:=NOT H1 TaskA Prog1 H1:=NOT H1 H1:=1H1:=0H1:=1 S1=1 Task Interval: Definitions: Task management in the XSoft
67
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 67 XSoft Task A Prio 5 Task B Prio4 Task A Prio 5 High priority tasks interrupt low priority tasks! Priorities of 0-31 are allowed ! Definition of Priority Task management in the XSoft
68
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 68 XSoft TaskA Prog1 H1:=NOT H1 TaskA Prog1 H1:=NOT H1 TaskA Prog1 H1:=NOT H1 H1:=1H1:=0H1:=1 1s Task Interval: TaskB Prog2 Cycle time error (Watchdog) If any one task can NOT complete the execution of its assigned programs within the defined interval, the PLC will go into HALT (watchdog) ! Definition of priorities Task management in the XSoft
69
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 69 XSoft Prog_L Prog_H Program execution time t 0T ProgL T ProgH (Task interval H) T IH (Task intervall L) T IL Prog_L 1. Break Prog_H T IRH Prio 0 1 Task_L: Task_H: Prog_L 2.Prog_L 3. 4. Break Prog_H Break Prog_H New Start 1. Prog_H T progL* Definition: Task Timing Task management in the XSoft
70
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 70 XSoft (Task interval L) T IL Break Prog_H T IRH Task_LL: Task_L: Break Prog_H Break Prog_H Prog_L 1.Prog_L 2.Prog_L 3. 4. Prog_L 1.Prog_L 2.Prog_L 3. T ProgL* Prog_L Prog_H Program execution time t 0T ProgL T ProgH Prio 0 1 Prog_LL 2 T ILR Prog_LL 4 Break etc. And what about 3 Tasks? Task management in the XSoft
71
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 71 XSoft Test and Commissioning
72
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 72 XSoft Watch- and recipe manager F2 Test and Commissioning
73
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 73 XSoft Breakpoint and single step Breakpoint Test and Commissioning
74
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 74 XSoft Sampling Trace Test and Commissioning
75
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 75 XSoft Address structure according to IEC 61131-3
76
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 76 XSoft Structure of an address Percent character ‘%’ Area prefix –IInput –QOutput –MMarker Size –XSingle Bit –NoneSingle Bit –BByte (8 Bits) –WWord (16 Bits) –DDouble word (32 Bits) Samples –%IW214 –%QX1.1 –%MD48 Manufacturer specific; not defined in the standard ! Address structure according to IEC 61131-3
77
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 77 XSoft Erzeugen einer Symboldatei
78
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 78 XSoft Variablen in eine globale Variablenliste eintragen! Schritt1: Projekt erstellen und speichern Erzeugen einer Symboldatei
79
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 79 XSoft Schritt 2: Übersetzen Erzeugen einer Symboldatei
80
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 80 XSoft Simulation abschalten Simulation Erzeugen einer Symboldatei
81
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 81 XSoft Schritt 3: Symboldateierzeugen anklicken Erzeugen einer Symboldatei
82
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 82 XSoft Schritt 5: Symbolfile konfigurieren Wegklicken! Symbolfile konfigurieren Anklicken! Erzeugen einer Symboldatei
83
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 83 XSoft Schritt 6: Auswahl der Variablen Erzeugen einer Symboldatei
84
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 84 XSoft Schritt 7: Auswahl zu Symbolliste hinzufügen Anklicken! Erzeugen einer Symboldatei
85
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 85 XSoft Schritt 8: Fenster mit OK verlassen und übersetzen Bestätigen! Erzeugen einer Symboldatei
86
Schutzvermerk nach DIN 34 beachten 20/04/15 Seite 86 XSoft Schritt 9: Übersetzen Erzeugen einer Symboldatei
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.