Q-Code User Manual
Ver. 7.0 2021/11/30
186
Ex.
Open Comparator function. If comparator is triggered, the system will execute INT_CMP.
TR1:CMP_ON
; Open Comparator function.
INT_CMP:!PB
; If comparator is triggered, the PB output is
inverted immediately.
Ex.
Open Capture function. When comparator is triggered, the system will execute INT_CMP. If
comparator is untriggered, the system will execute INT_TMR.
TR1:CMP_ON(1M)
; Open Capture function.
INT_CMP:CMP_Read(X0)
; If comparator is triggered, the captured time will
be read immediately.
INT_TMR:!PB
; If comparator is untriggered, the PB output is
inverted immediately.
4.10.2 CMP_OFF
Close Comparator function.
Note: NY4 / NY5 / NY5+ / NY6A / NY7 / NY9T / NX1 do not support this function.
Ex.
TR2:CMP_OFF
; Close Comparator function.
4.10.3 CMP_Read(Rj:Ri) / CMP_Read(Xi)
Read the count of Capture.
Note: NY4 / NY5 / NY5+ / NY6A / NY7 / NY9T / NX1 do not support this function.
Ex.
Save the count of Capture to X0.
INT_CMP: CMP_Read(X0)
; Save the received count of Capture to Register X0.
Ex.
Save the count of Capture to R0, R1.
INT_CMP: CMP_Read(R1:R0)
; Save the received count of Capture to Register R0,
R1.
4.10.4 CMP_CNT_ON (Count)
Activate the external input count function, it needs to specify count times. If the count times achieve,
system will execute INT_TMR.
Note:
1. NY4 / NY5 / NY5+ / NY6A / NY7 / NY9T / NX1 do not support this function.
2. If Counter occupy Timer resourse, the Timer function can not be used anymore.
Ex.
Open Counter function. If Counter is set to 10 times, the PB output
will be inverted immediately.
TR1: CMP_CNT_ON(10)
; Open Counter function and set to count 10 times.
INT_TMR:!PB
; If count up to 10 times, the PB
output will be inverted immediately.