NAME
counter -- simple counter - function for vector
PROTOTYPE
unitptr counter( int iMaxCount, unitptr uHost)
ARGUMENTS
- int iMaxCount
- nr of counting steps between resets (0 for indefinite)
- unitptr uHost
- host unit
RETURN VALUE:
A pointer to the created unit or NULL in the case of an error.
INTERFACE OF CREATED UNIT:
- CTL_in[1]:
- (control field) counting increment.
A value of 0 switches this unit off.
- X_out[1]:
- counted value since last reset
EXECUTION OF CREATED UNIT:
This unit counts in steps of size CTL_in[0]. When the units
has been newly created, the counter will be at zero (and
this value is present at output field X_out[0] ).
For each of the next iMaxCount exec_unit - calls,
the value at X_out[0] will be incremented
by the counting step size CTL_in[0] (default=1).
At the iMaxCount -th exec-call, the counter will restart
at zero, i.e., the value of X_in[0] will be reset from
iMaxCount to 0
and a new cycle of iMaxCount-1 subsequent incrementation steps begins.
A command ctrl_unit(iMode,u) with iMode=NST_RESET
also resets the counter.
A value of 0 for iMaxCount will make the counting limit infinite.
FILE
/amnt/loge/users/nistaff02/nistaff/rhaschke/nst7/man/../o.linux//../nstsrc/nst_misc.c