Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Jack H.Integration and automation of manufacturing systems.2001.pdf
Скачиваний:
80
Добавлен:
23.08.2013
Размер:
3.84 Mб
Скачать

page 194

AND(value,value,destination) - Binary and function OR(value,value,destination) - Binary or function NOT(value,value,destination) - Binary not function XOR(value,value,destination) - Binary exclusive or function

• Examples of the functions are,

AND

source A N7:0 source B N7:1 dest. N7:2

OR

source A N7:0 source B N7:1 dest. N7:3

XOR

source A N7:0 source B N7:1 dest. N7:4

NOT

source A N7:0 dest. N7:5

addr. data (binary)

N7:0 0011010111011011 N7:1 1010010011101010 after N7:2 1010010011001010 N7:3 1011010111111011 N7:4 1001000100110001 N7:5 1100101000100100

7.17 ADVANCED DATA HANDLING

page 195

7.17.1 Multiple Data Value Functions

We can also deal with large ‘chunks’ of memory at once. These will not be covered, but are available in texts. Some functions include,

-move/copy memory blocks

-add/subtract/multiply/divide/and/or/eor/not/etc blocks of memory

These functions are similar to single value functions, but they also include some matrix operations. For a PLC-5 a matrix, or block of memory is also known as an array.

The basic functions are,

FAL(control,length,mode,destination,expression) - will perform basic math operations to multiple values.

FSC(control,length,mode,expression) - will do a comparison to multiple values

COP(start value,destination,length) - copies a block of values FLL(value,destination,length) - copies a single value to a block of memory

• These functions are done on a PLC-5 using file commands. Typical operations include

file to file - copy an array of memory from one location to another. element to file - one value is copied to a block of memory

file to element - can convert between data types file add - add arrays

file subtract - subtract arrays file multiply - multiply arrays

file divide - divide an array by a value convert to/from BCD

AND/OR/XOR/NOT - perform binary functions.

• Examples of these functions are shown below.

page 196

 

FAL

 

 

Control R6:0

 

 

length 5

file to file

 

 

position 0

 

 

 

 

Mode all

 

 

Destination #N7:5

 

 

Expression #N7:0 + 5

 

 

 

 

 

 

 

 

FAL

 

 

Control R6:0

 

 

length 5

element to file

 

 

 

position 0

file to element

 

 

Mode incremental

 

 

Destination #N7:5

 

 

Expression N7:0 + 5

 

 

 

 

 

 

 

 

FAL

 

 

Control R6:0

 

 

length 5

 

 

 

 

position 0

file to element

 

 

Mode incremental

 

 

Destination N7:5

 

 

Expression #N7:0 + 5

 

 

 

 

• a useful function not implemented on PLC-5 processors is a memory exchange.

7.17.2 Block Transfer Functions

Certain PLC cards only have a single address (eg. O:001 or I:001) but multiple data values need to be read or written to it. To do this the block transfer functions are used.

These will be used in the labs for analog input/output cards.

page 197

These functions will take more than a single scan, and so once activated they will require a delay until they finish.

To use the write functions we set up a block of memory, the function shows this starting at N9:0, and it is 10 words long (this is determined by the special purpose card). The block transfer function also needs a control block of memory, this is BT10:1

 

 

 

 

 

 

 

BT10:1/EN

Advance

Block Transfer Write

 

 

 

 

 

 

Module Type Example Output Card

 

 

 

 

 

 

 

 

 

 

 

 

Rack 00

 

 

 

 

 

 

Group 3

 

 

 

 

 

 

Module 0

 

 

 

 

 

 

Control Block BT10:1

 

 

 

 

 

 

Data File N9:0

 

 

 

 

 

 

Length 10

 

 

 

 

 

 

Continuous No

 

 

 

 

 

 

 

 

 

 

 

 

 

 

• To read values we use a similar method. In the example below 9 values will be read from

the card and be placed in memory locations from N9:4 to N9:11.

 

 

 

 

 

 

 

BT10:0/15

read

BTR

 

 

 

 

 

 

Rack: 00

 

 

 

 

 

 

 

 

 

 

 

 

Group: 0

 

 

 

 

 

 

 

 

 

 

 

 

Module: 0

 

 

 

 

 

 

BT Array: BT10:0

 

 

 

 

 

 

Data File: N9:4

 

 

 

 

 

 

Length: 9

 

 

 

 

 

 

Continuous: no