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

page 182

• There are some memory locations that store indications of warning and fatal errors that have occurred. The routine in program file [S:29] needs to be able to detect and clear the fault.

S:29 - program file number to run when a fault occurs

• To set a timed interrupt we will set values in the status memory as indicated below. The program in file [S:31] will be run every [S:30]ms.

S:30 - timed delay between program execution - an integer number of ms S:31 - the program number to be run

• To cause an interrupt when a bit changes the following bits can be set.

S:46 - the program file to run when the input bit changes

S:47 - the rack and group number (eg. if in the main rack it is 000) S:48 - mask for the input address (eg. 0000000000000100 watches 02) S:49 - for positive edge triggered =1 for negative edge triggered = 0

S:50 - the number of counts before the interrupt occurs 1 = always up to 32767

7.13.3 Basic Data Handling

• Some handy functions found in PLC-5’s (similar functions are available in other PLC’s)

7.13.3.1 - Move Functions

• There are two types of move functions,

MOV(value,destination) - moves a value to a memory location MVM(value,mask,destination) - moves a value to a memory location, but

with a mask to select specific bits.

• The following function moves data values between memory locations. The following example moves a floating point number from floating point memory 7 to 23

page 183

MOV

Source F8:07

Destination F8:23

• The following example moves a floating point number from floating point memory F8:7 to

integer memory N7:23

MOV

Source F8:07

Destination N7:23

• The following example puts an integer value 123 in integer memory N7:23

MOV

Source 123

Destination N7:23

• A more complex example of the move functions follows,