Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Jack H.Automating manufacturing systems with PLCs.2005.pdf
Скачиваний:
261
Добавлен:
23.08.2013
Размер:
5.34 Mб
Скачать

plc memory - 14.14

EN - enable bit (bit 15)

EU - enable unload (bit 14)

DN - done bit (bit 13)

EM - empty bit (bit 12)

ER - error bit (bit 11)

UL - unload bit (bit 10)

IN - inhibit bit (bit 9)

FD - found bit (bit 8)

LEN - length word

POS - position word

Figure 14.16 Bits and Words for Control Memory

14.4.5 Integer Memory

Integer memory is 16 bit words that are normally used as 2s compliment numbers that can store data values from -32768 to +32767. When decimal fractions are supplied they are rounded to the nearest number. These values are normally stored in N7:xx by default, but new blocks of integer memory are often created in other locations such as N9:xx. Integer memory can also be used for bits.

14.4.6 Floating Point Memory

Floating point memory is available in newer and higher cost PLCs, it is not available on the Micrologix. This memory stores real numbers in 4 words, with 7 digits of accuracy over a range from +/-1.1754944e-38 to +/-3.4028237e38. Floating point memory is stored in F8:xx by default, but other floating point numbers can be stored in other locations. Bit level access is not permitted (or useful) for these numbers.

14.5SUMMARY

Program files store users programs in files 2 - 999.

Data files are available to users and will be 0-999 locations long.

Default data types on a PLC-5 include Output (O0:), Input (I1:), Status (S2:), Bit (B3:), Timer (T4:), Counter (C5:), Control (R6:), Integer (N7:) and Float (F8:).

Other memory types include Block Transfer (BT), ASCII (A), ASCII String (ST), BCD (D), Message (MG), PID Control (PD), SFC Status (SC).

plc memory - 14.15

In memory locations a ’/’ indicates a bit, ’.’ indicates a word.

Indirect addresses will substitute memory values between ’[’, ’]’.

Files are like arrays and are indicated with ’#’.

Expressions allow equations to be typed in.

Literal values for binary and hexadecimal values are followed by B and H.

14.6PRACTICE PROBLEMS

1.Can PLC outputs can be set with Bytes instead of bits?

2.How many types of memory can a PLC-5 have?

3.What are the default program memory locations?

4.How many types of number bases are used in PLC memory?

5.How are timer and counter memory similar?

6.What types of memory cannot be changed?

7.Develop Ladder Logic for a car door/seat belt safety system. When the car door is open, or the seatbelt is not done up, a buzzer will sound for 5 seconds if the key has been switched on. A cabin light will be switched on when the door is open and stay on for 10 seconds after it is closed, unless a key has started the ignition power.

8.Look at the manuals for the status memory in your PLC and find the first scan location

9.Write ladder logic for the following problem description. When button A is pressed a value of 1001 will be stored in N7:0. When button B is pressed a value of -345 will be stored in N7:1, when it is not pressed a value of 99 will be stored in N7:1. When button C is pressed N7:0 and N7:1 will be added, and the result will be stored in N7:2.

10.Using the status memory locations, write a program that will flash a light for the first 15 seconds after it has been turned on. The light should flash once a second.

11.How many words are required for timer and counter memory?

14.7 PRACTICE PROBLEM SOLUTIONS

1.yes, for example the output word would be addressed as O:000

2.There are 13 different memory types, 10 of these can be defined by the user for data files

plc memory - 14.16

between 3 and 999.

3.Program files 0 and 1 are reserved for system functions. File 2 is the default ladder logic program, and files 3 to 999 can be used for other programs.

4.binary, octal, BCD, 2s compliment, signed binary, floating point, bits, hexadecimal

5.both are similar. The timer and counter memories both use words for the accumulator and presets, and they use bits to track the status of the functions. These bits are somewhat different, but parallel in function.

6.Inputs cannot be changed by the program, and some of the status bits/words cannot be changed by the user.

7.

 

Inputs

 

Outputs

 

 

 

 

door open

 

buzzer

 

 

seat belt connected

 

light

 

 

key on

 

 

door open

 

key on

 

 

seat belt connected

T4:0/TT

door open

T4:1/DN

key on

 

 

 

 

 

 

 

 

 

 

TON

Timer T4:0

Delay 5s

buzzer

TOF

Timer T4:1

Delay 10s

light

8. S2:1/14 for micrologix, S2:1/15 for PLC-5.

plc memory - 14.17

9.

 

 

 

 

 

 

A

 

MOV

 

 

 

 

Source 1001

 

 

 

 

 

 

 

Dest N7:0

 

 

 

 

 

 

 

 

B

 

MOV

 

 

 

 

Source -345

 

 

 

 

 

 

 

Dest N7:1

 

 

 

 

 

 

 

 

 

B

 

MOV

 

 

 

 

Source 99

 

 

 

 

 

 

 

Dest N7:1

 

 

 

 

 

 

 

 

 

C

 

ADD

 

 

 

Source A N7:0

 

 

 

 

 

 

Source B N7:1

 

 

 

 

 

 

Dest N7:2