The text of a manual · part 43 of 50
Festo Software Tools: Statement list and Ladder diagram for SF 3, FST 200 Manual, pages 421 to 430
Pages 421 to 430 of 496
The original document is the PDF (3.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Festo FPC-202
Page 421
FST 200-LDR
Appendix B
X : logical EXOR link One memory location for the result is 1, provided that only one of the two EXOR-linked bits has the value 1.
EXOR link
Result
Arithmetic & logic: Effect: Several multi-bit operations can be performed and several operands can be linked with one another. Operand: The same requirements apply as for the multi-bit operations. Name: To distinguish the different arithmetic/logic boxes, you can identify them with names.
Module call: Effect: The same operations and operands can be used as you would find in a conventional LDR program, but without any additional module call. Name: This designates the type and the number of a module and can lie in the following area: Name = FM0 up to FM255 (for function modules) Name = MP0 up to MP7 (for program modules)
9610a
B-9
Page 422
FST 200-LDR
Appendix B
B.1.2 List of operands In this list, all operands are entered with their areas. In addition, this list also shows which operations are permissible for the operands. Flag: Operations:
Query, set, reset, assign, negate assignment F0.0 up to F31.15 One-bit operand
Flag words: Operations:
Compare, load
FW0 up to FW31
Multi bit operand
Initialisation flag (only in LDR): Operations:
Query
FI
One-bit operand
Input: Operations: I0.0 - I31.7 I0.0.0 - I0.15.7 I1.0.0 - I31.15.7 I1.0.0 - I31.7.15
Query One-bit, local inputs (incl. CP, AS-i) One-bit, diagnosis inputs One-bit, field bus inputs (8 bit) One-bit, field bus inputs (16 bit)
Input words: Operations: IW0 - IW31 IW0.0 - IW31.15 IW1.0 - IW31.7
B-10
Load, compare Multi bit, local inputs (incl. CP, AS-i) Multi bit, diagnosis and field bus inputs (8 bit) Multi bit, field bus inputs (16 bit)
9610a
Page 423
FST 200-LDR
Appendix B
Output: Operations:
Query, set, assign
O0.0 - O31.7 O0.0.0 - O0.15.7 O1.0.0 - O31.15.7 O1.0.0 - O31.7.15
One-bit, local outputs (incl. CP, AS-i) One-bit, outputs (not usable) One-bit, field bus outputs (8 bit) One-bit, field bus outputs (16 bit)
Output words: Operations:
Load, compare, assign
OW0 - OW31 OW0.0 - OW31.15 OW1.0 - OW31.7
Multi bit, local outputs (incl. CP, AS-i) Multi bit, diagnosis and field bus outputs (8 bit) Multi bit, field bus outputs (16 bit)
Counter: Operations:
One-bit: query, set, reset, assign negate assignment; Multi bit: compare, load C0 up to C31 Counter status, one-bit operand CW0 up to CW31 Counter word, multi bit operand CP0 up to CP31 Counter preselect, multi bit operand Preselected value: decimal +/-: -32768 up to +32767 decimal +: 0 up to 65535 hexadecimal: $0000 up to $FFFF
Timer: Operations:
One-bit: query, set, reset, assign negate assignment; multi bit: compare, load Timer status, Impulse timer, one-bit-operand Timer status delayed startup reTI0 up to TI31 sponse, one-bit-operand Timer status delayed shutdown TA0 up to TA31 response, one-bit-operand Timer word, multi bit-operand TW0 up to TW31 Timer preselection, multi bit-operand TP0 up to TP31 Preselected value: 0.00 u to 655.35s
9610a
B-11
Page 424
FST 200-LDR
Appendix B
Constant: Operations:
Compare, load
Vnnnnn
Multi bit-operand Range of values: Decimal +/-: -32768 up to +32767 Decimal +: 0 up to 65535 Hexadecimal: $0000 up to $FFFF
Register: Operations:
Compare, load
R0 up to R127
Multi bit-operand Range of values: Decimal +/-: -32768 up to +32767 Decimal +: 0 up to 65535 Hexadecimal: $0000 up to $FFFF
Function units: Operations:
Compare, load
FU0 up to FU4095
Special function unit Module parameter
Program: Operations:
Query, set, reset
P0 up to P15
One-bit-operand
Error: Operations: E EW
Query, reset One-bit-operand Multi bit-operand
Index register Operations: x, y
B-12
Load, compare, assign for indexed addressing Multi bit
9610a
Page 425
FST 200-LDR
Appendix B
Symbolic operands All aforementioned operands can be substituted with so-called symbolic operands. Please take into account that only upper and lower case letters, numerals and the underline symbol are permitted. To avoid ambiguity, you can only assign one single symbolic operand (identifier) to an operand. B.1.3 Syntax for designation of absolute operands Operand IW.b If.w.b IWw IWf.w OW.b Of.w.b OWw OWf.w Fw.b FWw Pp
9610a
Address key f = Field bus station no. w = Word number b = Bit number w = Flag word number b = Bit number P = number of program
B-13
Page 426
FST 200-LDR
B.2
Appendix B
Multitasking operation for programmable valve terminal with control block SF 3 The SF 3 has a multitasking-capable operating system. This is capable of processing two programs in an almost parallel fashion involving rapid switches between two processing cycles (tasks). This means that, while one task in a program is being processed, the other (background) program is not actually processed until the next task change takes place. Comment for modules Function and program modules form a fixed part of the calling program. They do not operate in parallel fashion with the calling program. Instead of a task from the calling program, a task from the module is processed. Multitasking characteristcs are described in detail in the SF-3 "Electronics" manual.
B-14
9610a
Page 427
FST 200-KOP
B.3
Appendix B
Program example The following program is intended to clarify the commands described in Chapter 5. The problem deals with a conceivable practical application. If you wish to enter and test this program, proceed in the manner described in the section following the program listing, under "Procedure". Problem description: Products are packed into boxes in a packing machine. A box can hold 50 products. A lamp should light up to indicate when a box is full. It must then be replaced rapidly with an empty box. A product directed towards the box should be detected by a mechanical sensor. Due to dirt and wear on the contact, this sensor then supplies the following signal to the controller. Contact open
Status 1 0
Contact closed
0.5s
To enable the correct quantity to be detected by this sensor, the signal processing must be suppressed using software. The suppression time should be 0.5 seconds. If a positive edge is in contact, no other positive edges have any effect on the process for the next 0.5 seconds. The quantity actually packed in the box should be detected by a counter and displayed on the controller in binary form by appropriate outputs which then light up.
9610a
B-15
Page 428
FST 200-KOP Appendix B FESTO
Allocation listing:
01.1 Full Carton full owe Display Display current carton contents Id.1 Part Recognize approaching part
18.2 Change Insert new carton
Fa.1 Edge Sinal edge change (Yes/No)
FI Start Initializing flag
TL Timert Debounced. pulse
C1 Counter Quantity reached (Yes/No)
CW1 Total Current content of carton
Example of program:
Rung 1: Initialization FI Ci H - ] [ - +. +. +. +. +. +. 5] Counter Change Full - - ] [ - + + - - ( R Edge L t+ Rf Va . +. TO Rung 2: recognize firt rising edge AWD Part Edge pH] [ - + +. +. +. +. + §, Y Edge Full Change C1 H - ] [ - + - ]/[, + - VI, + + + + - - ( INC), 4 7 + @.5s Timer - ow, - L +4+ Ul Rung 4: Edge flag off owe T1 Part Edge +] /[, + - ]/[, + + + + + - - ( R )] Rung 5: Switch-on carton full signal owa Full I > =}#+ +. +. +. +. + §, 5a
B-16 9610a
Page 429
FST 200-KOP
Appendix B
Explanations of the program Current path 1: The initialisation flag FI features the value 1 in the first processing cycle. This ensures that the operands named in the executive part have a defined initial state. The counter is initialised (counter preselect = 50; counter word = 0; counter status = 1) and the signal edge flag is reset. This is repeated whenever the box is changed. Current path 2: The first positive edge supplied to the controller by the sensor sets the edge flag. Current path 3: If the box is neither full nor being changed and a positive edge is present, the counter word and output word are increased by 1 and the timer is initialised and started. Current path 4: The sensor cannot record a 0 signal from the edge flag until the timer period has elapsed (0.5 seconds). The signal edge flag can therefore only be reset at the sensor with a positive edge once the timer period has elapsed, at which point a new counting process can be triggered. Current path 5: Once 50 products have been packed, there is an 1-signal on output O1.1 (full).
9610a
B-17
Page 430
FST 200-KOP
Appendix B
Procedure • Set up project (refer to Section 3.1); • Activate LDR-editor (refer to Section 5.1); • Enter program as illustrated and save; • Load program into controller. Ensure that the correct interface configuration is set and that the connection is O.K. (refer to Section 7.2.2). • Start program (also refer to Section 7.0); • Test program
Testing the program If you send a pulse to I0.1, the display for output O0.0 lights up. After a further pulse, the display for O0.1 lights up. After the third pulse, both displays light up etc. The bit number of the start represents the exponent for base 2. If for example the display for O0.4 lights up, the decimal value is calculated from 2^4 = 2*2*2*2=16 (present box contents). If you provide several pulses to input I0.1 within 0.5 seconds, the output word is only increased by 1. During the program input, you can also enter a larger timer preselection value to make it easier to test these characteristics.
B-18
9610a