Basic Course 01

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Top

Back

Contact Us

VOL. 1
Example Outline

Counting total number of products


Totaling the number of products on multiple production lines

The number of products travelling on each of 5 lines is counted simultaneously. When the total number of products on the 5 lines reaches 100 the KV outputs. An FS Series fiberoptic sensor counts the number of products on each line. When the total number equals the preset value, the KV outputs.

0000 0001 0002 0003 0004

Line 1 Products counted Line 2


0 1 2 3 4 5 6 7, 8

Line 3

Line 4

Input 0000: Counting products on line 1 Input 0001: Counting products on line 2 Input relay 0002: Counting products on line 3 Input relay 0003: Counting products on line 4 Input relay 0004: Counting products on line 5 Input relay 0005: Resetting Output relay 0500: Comparator output Visual KV Series

Line 5

FS Series Fiberoptic Sensor

s Programming Technique
The following 2 instructions can be used for counting. (1) Counter instruction (2) Increment Memory instruction The programs created using instruction (1) and (2) are as follows: Using instruction (1)
0005
#09999

Using instruction (2)


DM0001 STA DM0002 STA DM0003 STA DM0004 STA DM0005 STA 0000 0001 0002 0003 0004 0005 DM0000 INC DM0000 INC DM0000 INC DM0000 INC DM0000 INC $0000 DW DM0000

C001
0000 #09999

C001 LDA C002 LDA C003 LDA C004 LDA C005 LDA

C002
0001 #09999

C003
0002 #09999

C004
0003 #09999

C005
0004

2002

DM0001 DM0002 DM0003 DM0004 DM0005 DM0000 LDA ADD ADD ADD ADD STA

For the same control as shown here, using instruction (2) simplifies programming. Time and labor for debugging is saved. To obtain comparator output, the CMP instruction can be used.

Top

Back

Contact Us

VOL. 1 Counting total number of products


Programming Example
0000 0001 0001 0002 0002 0003 0003 0004 0004 0005 0005 0006 2002 0007 DM0000 #00100 CMP LDA 2009 DM0000 INC DM0000 INC DM0000 INC DM0000 INC DM0000 INC $0000 DW DM0000 0500 END 0008 ENDH 0009

When Input 0000 (line 1) turns ON, DM0000 is incremented by 1. When Input 0001 (line 2) turns ON, DM0000 is incremented by 1. When input relay 0002 (line 3) turns ON, DM0000 is incremented by 1. When input relay 0003 (line 4) turns ON, DM0000 is incremented by 1. When input relay 0004 (line 5) turns ON, DM0000 is incremented by 1. When input relay 0005 (reset input) turns ON, DM0000 is reset to 0. When DM0000 equals 100 or more, output relay 500 turns ON. When the reset input (0005) turns ON, output 0500 turns OFF.

Set the input time constant to 10 s using HSP instruction when the line speed is very high.

Tips

ORing Differentiation instructions


Compare the following 2 programs.
(1) 0000 0001 0002 0003 0004 DM0000 INC DM0000 INC DM0000 INC DM0000 INC DM0000 INC (2) 0000 0001 0002 0003 0004 DM0000 INC

In program (1), counting is performed for each input even when input relays 0000 to 0004 turn ON simultaneously. In program (2), simultaneous inputs are ignored when input relays 0000 to 0004 turn ON simultaneously. Referring to the above, program according to your purpose.

You might also like