1.使用加計(jì)數(shù)指令,遞增輸出CV的值。
2.每當(dāng)輸入信號(hào)CU的狀態(tài)從“0”變?yōu)?ldquo;1”(即信號(hào)上升沿),就會(huì)執(zhí)行該指令,同時(shí)輸出CV的當(dāng)前計(jì)數(shù)器值加1。計(jì)數(shù)器值會(huì)在每次檢測(cè)到信號(hào)上升沿時(shí)遞增,直到達(dá)到輸出CV所指定數(shù)據(jù)類型的上限。一旦達(dá)到上限,輸入信號(hào)CU的狀態(tài)將不再影響該指令的執(zhí)行。簡(jiǎn)而言之,該指令會(huì)持續(xù)檢測(cè)信號(hào)上升沿并遞增輸出CV的值,直到達(dá)到指定的上限。
3.Q輸出的信號(hào)狀態(tài)由參數(shù)PV決定。如果當(dāng)前計(jì)數(shù)器值大于或等于參數(shù)PV的值,則將輸出Q的信號(hào)狀態(tài)置位為“1”。在其它任何情況下,輸出Q的信號(hào)狀態(tài)均為“0”。
4.當(dāng)輸入R的信號(hào)狀態(tài)變?yōu)楦唠娖剑?ldquo;1”)時(shí),輸出CV的值會(huì)被重置為低電平(即“0”)。在此之后,只要輸入R保持高電平狀態(tài),無(wú)論輸入CU的信號(hào)狀態(tài)如何,輸出CV都將保持不變。

1. Use the add count command to increment the output CV value.
2. Whenever the state of the input signal CU changes from "0" to "1" (i.e. the rising edge of the signal), the instruction will be executed, and the current counter value of the output CV will be increased by 1. The counter value will increase every time the rising edge of the signal is detected, until it reaches the upper limit of the data type specified by the output CV. Once the upper limit is reached, the state of the input signal CU will no longer affect the execution of the instruction. In short, this instruction will continuously detect the rising edge of the signal and increase the output CV value until it reaches the specified upper limit.
The signal state output by Q is determined by the parameter PV. If the current counter value is greater than or equal to the value of parameter PV, set the signal status of output Q to "1". In any other case, the signal state of output Q is "0".
When the signal state of input R changes to high level (i.e. "1"), the value of output CV will be reset to low level (i.e. "0"). Afterwards, as long as the input R remains in a high level state, regardless of the signal state of the input CU, the output CV will remain unchanged.
