Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(EOD).Mechatronics.pdf
Скачиваний:
81
Добавлен:
23.08.2013
Размер:
5.07 Mб
Скачать

page 427

numbers. For the two bytes above the maximum numbers possible are from 0-9999 in BCD, but 0-64285 in binary.

• Convert the BCD number below to a decimal number,

0110 0010 0111 1001

• Convert the following binary number to a BCD number,

0100 1011

24.2.6 Advanced Data Handling

24.2.6.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.

page 428

• 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.

Соседние файлы в предмете Электротехника