You are on page 1of 21

Programmable Controller Basics

COUNTER UP
AND DOWN
IN MicroLogix 1000
Outline

1. Memory in Micrologix
1000
2. Inputs and Outputs
2. Counter in Micrologix
1000 and Its
Application Program
3. Example and Case
Memory In Micrologix 1000

• MEMORY
– Bit = 1or 0
– Byte = 8 bits
– Word(16 bits) 2 bytes
– Double Word= 2 words
• 32 bits
– Long Word=2 Double words
• 64 bits

Underlined text for MicroLogix 1000 only


Inputs & Outputs
File #0 File Type
Bit Number
(0-5,11)

O0:0/0
0
Outputs

File contains 11 5 0
File Number
6 or 12 Outputs Word 0 000000000000

File Type
File #1 Input Number
(0-9,19)
1
Inputs I1:0/0 15 9 0
File Number Word 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
File contains
Word 1 0000
10 or 20 Inputs
19 16
Counters

• Counter Operation
– The counter counts (by one) every time its rung goes from FALSE
to TRUE. When a specified number of counts has been reached,
the counter alerts the rest of the program by setting a bit. The
program must reset the counter to start counting from zero again.

I:0.0
||
0
Counter Application
Counter Application Cont.
Counter Application Cont.
Counters

• File #5
– 32 Counters (MicroLogix 1000 only)
– Up, Down, Up/Down

File Type
Counter Number
(0-31)

C5:0
5
Counters

File contains File Number


32 counters
Counters In Micrologix 1000

File Type
Counter Number
(0-31)
5
Counters
C5:0 15 14 13 12 11
Word 0 CU CD DN OV UN
File contains File Number Word 1 Preset Value
32 counters Word 2 Accumulated Value

Preset C5:0.PRE How many the counter should count up to


Accumulated C5:0.ACC How many the counter has counted already.

Done C5:0/DN Set to “1” when accumulated value > preset value.
Count Up C5:0/CU Set to “1” when state of CTU rung are true.
Count Down C5:0/CD Set to “1” when state of CTD rung are true.
Over/Underflow C5:0/OV,UN Set to “1” when counter counts past 32,767 or -32,768.
Counter Up (CTU) and Down (CTD)
The CTU instruction counts upward

Symbol

The CTD instruction counts downward

Symbol
Reset

Symbol

Clear the ACC value of counter


Program Example 1
Program Example 2
Case :
Parkir Garage Counter

Sensor_In Full_Indicator
I1:0/0 O0:0/0

Sensor_Out Reset_switch
I1:0/1 I1:0/2
Parkir Garage Counter
TERIMA KASIH
Case

Once the photoelectric sensor detects 10 products, the robotic


arm will begin to pack up. When the action is completed, the
robotic arm and the counter will be reset.
ML 1000 Memory Organization

Integer Files
6

Control File
5

Counter File
4

Timer File
3

Bit File
2

Status File
1

Input File
0

Output File
FILES
DATA

MicroLogix 1000 only


MicroLogix 1000
MEMORY
Bit File

• File #3 (32 registers or words)


15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 0: 0000 0000 0000 0000
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
7 6 5 4
B3:1/0
15 14 13 12 11 10 9 8 3 2 1 0 (RSLogix,APS)
Word 1:
0000 0000 0000 0000 OR
47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 B/16
Word 2: 0000 0000 0000 0000 (HHP)

511 496
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 31: 0000 0000 0000 0000

You might also like