DVP - ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming

M1000

DCNT C251 K100

DHSCS K100

C251

M0

¾When C251 counts up and the value in C251 varies from 100 to101, DHSCS instruction sets M0 ON.

¾When C251 counts down and the value in C251 varies from 100 to 99, DHSCR instruction resets M0.

¾Timing diagram for the comparison:

1

2

M0

Counting

No.

98

99

 

100

101

 

 

 

 

 

101

 

100

99

 

98

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Count up

 

 

 

 

 

Count down

 

 

 

 

 

 

 

 

 

 

Time

Program Example 3:

Executes interrupt subroutine by applying software comparator.

I010

EI

M1000

DCNT C235 K100

DHSCS K100

C235

I010

FEND

M1000

OUT Y10

IRET

END

¾When value in C235 varies from 99 to100, interrupt subroutine triggered by I010 executes immediately to set Y0 ON.

Points to note:

¾If operand D is specified as S, M or Y0~Y3 for the above high speed comparison, the compare result will immediately output to the external points Y0~Y3 (Y0~Y5 for SS2/SX2). However, if D is specified as Y4~Y337, external outputs will be updated till the end of program (delay for one scan cycle).

3 - 128

Page 244
Image 244
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Dhscs K100