17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>DVP</strong>-<strong>ES2</strong>/<strong>EX2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

M1000<br />

DCNT C251 K100<br />

DHSCS<br />

K100<br />

C251<br />

M0<br />

‣ When C251 counts up and the value in C251 varies from 100 to101, DHSCS instruction<br />

sets M0 ON.<br />

‣ When C251 counts down and the value in C251 varies from 100 to 99, DHSCR<br />

instruction resets M0.<br />

‣ Timing diagram for the comparison:<br />

1 2<br />

M0<br />

Counting<br />

No.<br />

101<br />

100<br />

99<br />

98<br />

Count up<br />

101 100 99 98<br />

Count down<br />

Program Example 3:<br />

Executes interrupt subroutine by applying software comparator.<br />

Time<br />

M1000<br />

DCNT C235 K100<br />

EI<br />

DHSCS<br />

K100<br />

C235<br />

I010<br />

I010<br />

M1000<br />

OUT<br />

Y10<br />

FEND<br />

IRET<br />

END<br />

‣ When value in C235 varies from 99 to100, interrupt subroutine triggered by I010 executes<br />

immediately to set Y0 ON.<br />

Points to note:<br />

‣ If operand D is specified as S, M or Y0~Y3 for the above high speed comparison, the compare<br />

result will immediately output to the external points Y0~Y3 (Y0~Y5 for <strong>SS2</strong>/<strong>SX2</strong>). However, if<br />

D is specified as Y4~Y337, external outputs will be updated till the end of program (delay for<br />

one scan cycle).<br />

3-128

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!