Chapter 11 High-speed Capture and Compare Function (2) A deviation often occurs when the present position of an axis or the value in C200/C204/C208/C212 is read. To prevent a deviation from occurring, users read a value immediately by setting an input terminal to ON. Capture is described below. Block (A): The instruction TO is used to write data into control registers (block C). Block (B): Users set a capture source (block D), set bit 5~bit 4 to 0 (block E), and set a trigger (block F) in a control register. Block (C): The capture of a value (block D) is triggered by an input terminal, and the value captured is stored in data registers. Block (D):
The present positions of four axes, the values in C200, C204, C208, and C212 are capture sources. Block (E): Capture mode Block (F): External trigger Block (G): The instruction FROM is used to read data from control registers (block C) and data registers (block B). The values stored in the data registers are values captured. Procedure for a high-speed capture: The instruction TO is used to write data into control registers (block A).→An input terminal is set to ON (block F).→The present position of the 1 st /2 nd /3 rd /4 th axis, or the value in C200/C204/C208/C212 is captured (block D).
The value captured is stored in data registers (block C).→Users read the value captured by means of the instruction FROM. Example 【 Description 】 Start the high-speed counter C204. The value in C204 is captured when X0.1 is set to ON. 【 Steps 】 1. When SM002 in O100 is ON, the initial setting of high-speed capture is carried out. D0=0 Initial group number n=0 D1=0 D20=10 Writing 6 values by means of the instruction TO (Only one value is captured.) D60=10 Reading 6 values by means of the instruction FROM (Only one value is captured.) 2. When M1 is ON, the high-speed capture is set. The value in (D3, D2) is 16#1005. The capture source set is C204.
(The value of bit 3~bit 0 is 5). The mode selected is a capture mode. (The value of bit 5~bit 4 is 0.) The trigger selected is X0.1. (The value of bit 15~bit 12 is 1.) The value in (D5, D4) is K100. Users can set (D5, D4) by themselves. 3. The high-speed capture is started when M2 is ON. 11-11 (D)FROM K253 K1 D0 D50 (A)TO K253 K1 D0 D50 (C) Data register n (n=0~7) (B) Control register n (n=0~7) (D) Capture source (F) Trigger (E) Capture mode (D) Capture source (F) Trigger (E) Capture mode