Chapter 11 High-speed Capture and Compare Function set, the output terminal selected will be set to ON, the counter selected will be reset, the output terminal selected will be reset to OFF, or the counter selected will not be reset. Block (G): If a comparison condition is met, Y0.8, Y0.9, Y0.10, Y0.11, C200, C204, C208, or C212 will be set or reset. Procedure for a high-speed comparison: The instruction TO is used to write data into control registers and data registers (block A).→The comparison source set (block E) is compared with the value in data registers (block D).
The comparison result meets the condition set (block F).→Y0.8, Y0.9, Y0.10, Y0.11, C200, C204, C208, or C212 will be set or reset (block G). Example A manual pulse generator is used to generate pulses that are sent to C204 in AH10PM-5A. Comparison conditions: If the value in C204 is greater than 100, Y0.9 will be set to ON. If the value in C204 is greater than 300, Y0.9 will be reset to OFF. Two comparators are used in a program. One comparator is used to set Y0.9 to ON, and the other is used to reset Y0.9 to OFF. When Y0.9 is set to ON, no LED indicator on AH10PM-5A will indicate that Y0.9 is ON, but users can know whether Y0.9 is ON by means of its external wiring.
As a result, the terminal C1 is connected to the terminal 24G, Y0.9 is connected to X0.2-, X0.2+ is connected to +24V, and X0.10 and X0.11 are connected to a manual pulse generator. 【 Description 】 【 Steps 】 1. After O100 is started, the initial setting of two high-speed comparisons will be carried out. D0=0 Initial group number n=0 D1=0 D20=10 Writing 10 values by means of the instruction TO (two groups of high-speed comparison values) D60=10 Reading 10 values by means of the instruction FROM (two high-speed comparison values) 2. Two groups of high-speed comparison values are set when M1 is ON. First group: The value in (D3, D2) is 16#125.
The comparison source set is C204. (The value of bit 3~bit 0 is 5.) The comparison condition set is greater than or equal to. (The value of bit 5~bit 4 is 2.) The output action selected is set. (The value of bit7~bit 6 is 0.) The terminal selected is Y0.9. (The value of bit11~bit 8 is 1.) First group: The value in (D5, D4) is K100. If the value in C204 is greater or equal to K100, Y0.9 will be set to ON. Second group: The value in (D7, D6) is 16#165. The comparison source set is C204. (The value of bit 3~bit 0 is 5.) The comparison condition set is greater than or equal to. (The value of bit 5~bit 4 is 2.) The output action selected is reset.
(The value of bit7~bit 6 is 1.) The terminal selected is Y0.9. (The value of bit11~bit 8 is 1.) Second group: The value in (D9, D8) is K300. If the value in C204 is greater or equal to K300, Y0.9 will be reset to OFF. 3. The two high-speed comparisons are started when M2 is ON. 11-5