### PRGM – Setpoint programmer

Block SymbolLicensing group: STANDARD

Function Description
The PRGM block generates functions of time (programs) composed of n linear parts defined by $\left(\mathtt{\text{n}}+1\right)$-dimensional vectors of time ($\mathtt{\text{tm}}=\left[{t}_{0},\dots ,{t}_{n}\right]$) and output values ($\mathtt{\text{y}}=\left[{y}_{0},\dots ,{y}_{n}\right]$). The generated time-course is continuous piecewise linear, see figure below. This block is most commonly used as a setpoint generator for a controller. The program generation starts when $\mathtt{\text{RUN}}=\mathtt{\text{on}}$. In the case of $\mathtt{\text{RUN}}=\mathtt{\text{off}}$ the programmer is set back to the initial state. The input $\mathtt{\text{DEF}}=\mathtt{\text{on}}$ sets the output sp to the value spv. It follows a ramp to the nearest future node of the time function when $\mathtt{\text{DEF}}=\mathtt{\text{off}}$. The internal time of the generator is not affected by this input. The input $\mathtt{\text{HLD}}=\mathtt{\text{on}}$ freezes the output sp and the internal time, thus also the outputs tsc, tt and rt. The program follows from freezing point as planned when $\mathtt{\text{HLD}}=\mathtt{\text{off}}$ unless the input $\mathtt{\text{CON}}=\mathtt{\text{on}}$ at the moment when the signal HLD on$\to$off. In that case the program follows a ramp to reach the node with index ind in time trt. The node index ind must be equal to or higher than the index of current sector isc (at the moment when HLD on$\to$off). If $\mathtt{\text{RPT}}=\mathtt{\text{on}}$, the program is generated repeatedly.

Inputs

 RUN Enable execution Bool DEF Initialize sp to the value of spv Bool spv Initializing constant Double (F64) HLD Output and timer freezing Bool CON Continue from defined node Bool ind Index of the node to continue from Long (I32) trt Time to reach the defined node with index ind Double (F64) RPT Repetition flag Bool

Outputs

 sp Setpoint variable (function value of the time function at given time) Double (F64) isc Current function sector Long (I32) tsc Time elapsed since the start of current sector Double (F64) tt Time elapsed since the start of program generation Double (F64) rt Remaining time till the end of program Double (F64) CNF Flag indicating that the configured curve is being followed Bool E Error flag – the node times are not ascending Bool

Parameters

 n Number of sectors  $↓$1 $↑$10000000 $\odot$2 Long (I32) tmunits Time units  $\odot$1 Long (I32) 1 .... seconds 2 .... minutes 3 .... hours tm $\left(\mathtt{\text{n}}+1\right)$-dimensional vector of ascending node times  $\odot$[0 1 2] Double (F64) y $\left(\mathtt{\text{n}}+1\right)$-dimensional vector of node values (values of the time function)  $\odot$[0 1 0] Double (F64)

2020 © REX Controls s.r.o., www.rexygen.com