You are on page 1of 21

Programmable Controller Basics

Memory & Data


MicroLogix Packaged Controllers

We are going to discuss...

1. Memory 2. Data 3. Data Files

ML 1000 Memory Organization

6 - 15 7
Integer Files Control File Counter File Timer File Bit File Status File Input File Output File

STI File HSC File Error File Main Program Reserved System

PROGRAM FILES

DATA FILES

Subroutine Files

MicroLogix 1000 only


MicroLogix 1000 MEMORY

ML 1000 Memory Organization

Integer Files Control File Counter File Timer File Bit File Status File Input File Output File

DATA FILES

MicroLogix 1000 only


MicroLogix 1000 MEMORY

Memory & Data


MEMORY
Bit = 1or 0 Nibble = 4 bits Byte = 2 nibbles Word(16 bits) 2 bytes Double Word= 2 words
32 bits

DATA
Octal 0-7 BCD 0-9 HEX 0-F (15) Integer (signed) -32768 to +32767 Unsigned Integer 65,535 (32767 + 32767) Floating Point
IEEE +/- 3.45x1038 to +/1.17x10-38

Long Word=2 Double words


64 bits

Underlined text for MicroLogix 1000 only

Data Structure
15 14 13 12 11 10 9 8 11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0 3 2 1 0

Word =16 bits :


ASCII Data : Integer Data :

0000 0000 0000 0000


15 14 13 12

0000 0000 0000 0000


Signed INTEGER between -32,768 & 32,767
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

BCD Data :
HEX Data :

0000 0000 0000 0000


15 14 13 12 11 10 9 8

7 6 5 4

3 2 1 0

0000 0000 0000 0000

ASCII TABLE
ASC HEX DEC II NUL 00 0 SOH 01 1 STX 02 2 ETX 03 3 EOT 04 4 ENQ 05 5 ACK 06 6 BEL 07 7 BS 08 8 HT 09 9 LF 0A 10 VT 0B 11 FF 0C 12 CR 0D 13 SO 0E 14 SI 0F 15 DLE 10 16 DC1 11 17 DC2 12 18 DC3 13 19 DC4 14 20 NAK 15 21 SYN 16 22 ETB 17 23 CAN 18 24 EM 19 25 ASC HEX DEC II SUB 1A 26 ESC 1B 27 FS 1C 28 GS 1D 29 RS 1E 30 US 1F 31 SP 20 32 ! 21 33 22 34 # 23 35 $ 24 36 % 25 37 & 26 38 27 39 ( 28 40 ) 29 41 * 2A 42 + 2B 43 2C 44 2D 45 . 2E 46 / 2F 47 0 30 48 1 31 49 2 32 50 3 33 51 ASC HEX DEC II 4 34 53 5 35 54 6 36 55 7 37 56 8 38 57 9 39 58 : 3A 59 ; 3B 60 < 3C 61 = 3D 62 > 3E 63 ? 3F 64 @ 40 65 A 41 66 B 42 67 C 43 68 D 44 69 E 45 70 a b c ~ DEL 61 62 63 7E 7F 97 98 99 126 127

Inputs & Outputs


File #0
0
Outputs
File contains 6 or 12 Outputs File Type Bit Number (0-5,11)

O0:0/0
File Number
Word 0

11

000000000000

File #1
1 Inputs
File contains

File Type

Input Number (0-9,19)

I1:0/0
File Number
Word 1

15

Word 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0000 19 16

10 or 20 Inputs

Status File
File #2
General purpose file that consists of 32 registers (words). These registers are mixed in word and bit formats depending on the function they represent. The Status file is primarily used for:
Setting system operating features, Displaying system status and faults

Programming aids consisting of:


Timebase bits Math overflow flags Index registers Subroutine control

Bit File
File #3 (32 registers or words)
15 14 13 12 15 14 13 12 11 10 9 8 11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0 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 15 14 13 12 11 10 9 8 3 2 1 0

B3:1/0 (RSLogix,APS)
OR

Word 1:

0000 0000 0000 0000


47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 7 6 5 4 15 14 13 12 11 10 9 8 3 2 1 0

Word 2:

0000 0000 0000 0000


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

B/16 (HHP)

Word 31:

0000 0000 0000 0000

Timers
Timer Operation
The timer times as long as its rung is TRUE. When the timer times up to a specified value, it alerts the rest of the program by setting a bit. When the rung becomes FALSE, the timer stops timing and resets itself to zero.

I:0.0

||

Timers
File #4
40 Timers (MicroLogix 1000 only) TON, TOF, and RTO
Timer On Delay Timer Off Delay Retentive Timer On

.01 and 1 second time base


File Type Timer Number (0-39)

Timers
File Number

T4:0

File contains 40 timers

Timers

File Type

Timer Number (0-39)

Timers
File Number

T4:0
15 14 13 Word 0 EN TT DN Word 1 Word 2

File contains 40 timers

Preset Value Accumulated Value

Preset Accumulated Done Timer Timing Enable

T4:0.PRE T4:0.ACC T4:0/DN T4:0/TT T4:0/EN

How long the timer should time for. How long the timer has timed for already. Set to 1 when accumulated value > preset value. Set to 1 when accumulated value < preset value. Set to 1 when the rung containing the timer is true.

Timers
The Timers done bit turns the motor off after a 10 second time delay
Stop Start Timer Done

Motor

I:0/1

I:0/0

T4:0/DN

O:0/3

]/ [

][
O:0/3
M1

]/[

( )

][
O:0/3
M1

TON
TIMER ON DELAY Timer T4:0 Time Base 1.0 Preset 10 Accum 0

][

(EN) (DN)

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

||

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

File Type

Counters

C5:0
File Number

Counter Number (0-31)

File contains

32 counters

Counters
File Type

Counters

C5:0
File Number C5:0.PRE C5:0.ACC

Counter Number (0-31)


15 14 13 12 11

Word 0 CU CD DN OV UN

File contains 32 counters Preset Accumulated

Word 1 Word 2

Preset Value Accumulated Value

How many the counter should count up to How many the counter has counted already.

Done
Count Up Count Down Over/Underflow

C5:0/DN
C5:0/CU C5:0/CD

Set to 1 when accumulated value > preset value.


Set to 1 when state of CTU rung are true. Set to 1 when state of CTD rung are true.

C5:0/OV,UN Set to 1 when counter counts past 32,767 or -32,768.

Counters
The Counters done bit stops the motor from running, after 10 operations.
Stop

Start

Counter Done

Motor

I:0/1

I:0/0

C5:0/DN

O:0/3

]/[

][
O:0/3
M1

]/[

( )

][
O:0/3
M1

CTU
Count Up Counter Preset Accum C5:0 10 0

][

(CU) (DN)
C5:0

Reset

I:0/4

][

(RES)

Control
File #6
Used for higher level application specific commands.
FIFO/LIFO Stacks Sequencers Bit Shifts etc..

Required to allow the PLC to manage/control the application instruction. 16 Registers (words) in MicroLogix 1000

Control
File Type

Control
File Number

R6:0
Word 0 Word 1 Word 2

Control Number (0-15)

EN EU DN EM ER UL IN FD

Error Code

File contains 16 controls Length Position Enable

Length Value Position Value

R6:0.LEN R6:0.POS R6:0/EN

Length of control file Position in control file Set to 1 when state of Control rung are true.

Unload Enable
Done Stack Empty Error Unload Inhibit Found

R6:0/EU
R6:0/DN R6:0/EM R6:0/ER R6:0/UL R6:0/IN R6:0/FD

See FFU and LFU


See Instruction type Set to 1 when stack is empty. Set to 1 when error encountered . Stores status of bit unloaded (Bit shift only) See Instruction Type See Sequencer compare instruction (SQC)

Integer
File #7
General purpose data registers (words) Primarily used for:
Comparison instructions Math instructions Sequencers FIFO and LIFO stacks

105 Registers (words) in MicroLogix 1000

You might also like