31
Examples of Counter Unit Operation
Section 3-1
3-1-2
Present Count Value Reading
If the following bits in the output area for the Counter Unit have been set to
ON, the set values or the present count value (count value) will always be
read to words m and m+1 in the input area.
To read set value 1:
Output area word n+2, bit 04
To read set value 2:
Output area word n+2, bit 05
To read count value: Output area word n+2, bit 06
The simplest example of a program to commence count operation and obtain
the count value is given in the following. For details refer to 5-4 GT1-CT01
Counter Unit.
Note
1.
To execute counting, it is necessary to set the count mode. If the count
mode is changed during count operation, however, the count value will be
cleared to 0.
2.
Setting and reading will not be executed if a bit with a higher priority is ON.
As shown in the following example, therefore, it is recommended that word
n+2 be used with the MOV instruction.
3-1-3
Counter Setting and Execution
When the program is executed, the necessary settings for the Counter Unit
will be made, and count operation will start. During count operation, external
outputs 1 and 2 of the Counter Unit will automatically switch ON or OFF,
according to the count value.
Note It will be necessary to reset all the settings, including the set values,
present value and count mode, every time the Counter Unit is turned
ON.
When execution of count value reading is indicated
(execution conditions are ON), set the following condi-
tions:
•
Word 53
Bit 03: Data code BCD
Bit 06: Count value reading
Bits 10, 11: Count mode phase difference
×
1
The count value will subsequently be sent to words m
and m+1 (353, 354) of the Counter Unit automatically.
MOV(21)
#0C40
053
END(01)
Execution
Condition
Summary of Contents for DRT1-COM
Page 1: ...OPERATION MANUAL Cat No W348 E1 05 DRT1 COM GT1 Series DeviceNet MULTIPLE I O TERMINAL ...
Page 2: ...DRT1 COM GT1 Series DeviceNet MULTIPLE I O TERMINAL Operation Manual Revised May 2003 ...
Page 3: ...iv ...
Page 5: ...vi ...
Page 233: ...DRT1 COM GT1 Series DeviceNet MULTIPLE I O TERMINAL Cat No W348 E1 05 OPERATION MANUAL ...