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

plc basic functions - 15.34

11.

AND

Source A I:001

Source B 0000 0010 0001 0100 (binary)

Dest N7:0

EQU

Source A 0000 0010 0001 0100 (binary) O:000/4

Source B N7:0

12.

The data in the source location will be moved bit by bit to the destination for every bit that is set in the mask. Every other bit in the destination will be retain the previous value. The source address is not changed.

N7:2 = (N7:0 & N7:1) + (N7:2 & N7:1)

15.8 ASSIGNMENT PROBLEMS

1.Write a ladder logic program that will implement the function below, and if the result is greater than 100.5 then the output O:0.0/0 will be turned on.

X = 6 + AeB cos ( C + 5)

where,

 

A = N7:0

B = F8:0

C = N7:1

X = F8:1

2.Use an FAL instruction to average the values in N7:0 to N7:20 and store them in F8:0.

3.Write some simple ladder logic to change the preset value of a counter. When the input ‘A’ is active the preset should be 13, otherwise it will be 9.

4.The 16 input bits from I:000 are to be read and EORed with the inputs from I:001. The result is to be written to the output card O:002. If the binary pattern of the outputs is 1010 0101 0111 0110 then the output O:003/0 will be set. Write the ladder logic.

5.A machine ejects parts into three chutes. Three optical sensors (A, B and C) are positioned in each of the slots to count the parts. The count should start when the reset (R) button is pushed. The count will stop, and an indicator light (L) turned on when the average number of parts counted equals 100.

plc basic functions - 15.35

6.Write ladder logic to calculate the average of the values from N10:0 to N10:99. The operation should start after a momentary contact push button A is pushed. The result should be stored in N7:0. If button B is pushed, all operations should be complete in a single scan. Otherwise, only ten values will be calculated each scan. (Note: this means that it will take 10 scans to complete the calculation if A is pushed.)

7.Write and simplify a Boolean equation that implements the masked move (MVM) instruction.

8.a) Write ladder logic to calculate and store the binary sequence in integer memory starting at N7:0 up to N7:200 so that N7:0 = 1, N7:1 = 2, N7:2 = 4, N7:3 = 8, N7:4 = 16, etc. b) Will the program operate as expected?