Article translated with the assistance of AI tools. Images and parts of the content will still be reviewed.
Functional block that acts as an incrementer and decrementer.
INPUTS
CU : BOOL; if a rising edge occurs at this input, the counter value (CV) is incremented by 1 until it reaches PV.
CD : BOOL; if a rising edge occurs at this input, the counter value (CV) is decremented by 1 until it reaches 0.
RESET : BOOL; if TRUE, CV will be reset to zero.
LOAD : BOOL; if TRUE, it will be set to the value of PV.
PV : WORD; upper limit for incrementing or decrementing CV.
ATTENTION: The WORD data type, used for PV in MasterTool IEC XE, does not correspond to the IEC standard, which specifies the INT data type for this.
OUTPUTS
QU : BOOL; returns TRUE when CV is incremented to a value >= PV.
QD : BOOL; returns TRUE when CV is decremented to 0.
CV : WORD; contains the value to be incremented or decremented; will be initialized to 0 if RESET is TRUE; will be increased by 1 whenever there is a rising edge from FALSE to TRUE on CU; will be decreased by 1 whenever there is a falling edge from TRUE to FALSE on CD, as long as the value is not less than 0.
Comments
0 comments
Please sign in to leave a comment.