Вы находитесь на странице: 1из 2

COMPARISON TABLE LOAD - Defines a comparison table

Description Instruction forms the comparison table for working with high-speed counter. Depending on parameter C, comparison can be immediate or it can be called upon with instruction INI.

C 000 001 002 003

Function Registers comparison table containing values and starts comparing Registers comparison table containing ranges and starts comparing Registers comparison table containing values. Comparing starts with INI instruction Registers comparison table containing ranges. Comparing starts with INI instruction

When the current value of PV matches some of the specified table values or it belongs to one of the specified ranges, the appropriate subroutine is called. If the high-speed counter is not enabled in PC area (DM6642) instruction CTBL cannot be executed. Comparing with values Comparison table can have up to 16 values. Each of these values is assigned a number of subroutine that is called when the current value matches the table value. With CPM1 and CPM1A models, comparison is done one at a time in each cycle, while with models CPM2A and CPM2C comparison is done for all table values simultaneously. After comparing with the last table value, comparison starts from the first value again. The table below shows the structure of the comparison table containing values. Each value is assigned three words in the table. If the value FFFF is used as the number of subroutine, no subroutine will be executed in case of a match.

TB TB+1 TB+2 TB+3 ...

Number of values that current value is compared with (0001 to 0016, BCD) Value no.1 (lower four digits in BCD format) Value no.1 (higher four digits in BCD format) Number of subroutine for matching the first value

Comparing with a range of values Comparison table with ranges contains 8 ranges, which the current value PV is compared with. Ranges can overlap, allowing that the current value PV falls into several of these; in this case, the subroutine of the first matching area is called. If the value FFFF is used as the number of subroutine, no subroutine will be executed in case of a match.

TB TB+1 TB+2 TB+3 TB+4 ... TB+35 TB+36 TB+37 TB+38 TB+39 Ladder symbol

Lower value no.1 (lower four digits in BCD format) Lower value no.1 (higher four digits in BCD format) Higher value no.1 (lower four digits in BCD format) Higher value no.1 (higher four digits in BCD format) Number of subroutine in case that the current value PV is within range no.1 Lower value no.8 (lower four digits in BCD format) Lower value no.8 (higher four digits in BCD format) Higher value no.8 (lower four digits in BCD format) Higher value no.8 (higher four digits in BCD format) Number of subroutine in case that the current value PV is within range no.8

Limitations

In each area lower border has to be lower than the upper border. Number of subroutine can be used for several ranges. Table has to belong to a single memory area. Parameter D has to be 000 and the parameter C has to be 000, 001, 002 or 003. ER flag changes state to ON if an error concerning the value of instruction operand occurred.

Flag

Вам также может понравиться