Time-triggered dosage

Overview

Functions to configure and control time-triggered dosage.

Time trigger dosage is a feature that enables time-triggered start of dosage processes. Each pump contains batch list. This list stores single batch entries. A batch entry contains the complete configuration for one single time-triggered dosage task. A batch entry contains

  • Flow
  • Volume
  • Date and Time
  • Cycles
  • Period The flow and volume values are the configuration for the dosage process that is triggered at a certain time. The date and time value configures The absolute date and time, when this dosage will be triggered the first time. The number of cycles configures how often this dosage should be repeated. A value of 0 indicates an infinite repetition. The period configures the time between two consecutive dosages.
+ Collaboration diagram for Time-triggered dosage:

Functions

long LCP_AddBatchEntry (dev_hdl hPump, double Volume, double Flow, unsigned long Time, unsigned long Cycles, unsigned long PeriodSecs)
 Adds a single entry to list of batch entries. More...
 
long LCP_ClearBatchList (dev_hdl hPump)
 Deletes all entries from a pumps batch list. More...
 
long LCP_GetBatchEntry (dev_hdl hPump, unsigned long Time, dev_hdl *pBatchEntryHdl)
 This function returns a handle to a certain batch entry. More...
 
long LCP_GetBatchEntryAtIndex (dev_hdl hPump, unsigned long Index, dev_hdl *pBatchEntryHdl)
 This function returns a handle to a certain batch entry. More...
 
long LCP_GetBatchEntryParam (dev_hdl BatchEntryHdl, double *pVolume, double *pFlow, unsigned long *pTime, unsigned long *pCycles, unsigned long *pPeriodSecs)
 This function returns the configuration of a certain batch entry. More...
 
long LCP_GetBatchListSize (dev_hdl hPump)
 Query current number of entries in a pumps batch list. More...
 
long LCP_GetNextDosageTime (dev_hdl hPump)
 Returns time of next dosage event. More...
 
long LCP_IsBatchRunning (dev_hdl hPump)
 Check if batch processing is active. More...
 
long LCP_RemoveBatchEntry (dev_hdl hPump, unsigned long Time)
 Remove batch entry from list of batch entries. More...
 
long LCP_StartBatchProcessing (dev_hdl hPump)
 Start processing of batch list. More...
 
long LCP_StopBatchProcessing (dev_hdl hPump)
 Stop processing of batch list. More...
 

Function Documentation

long LCP_AddBatchEntry ( dev_hdl  hPump,
double  Volume,
double  Flow,
unsigned long  Time,
unsigned long  Cycles,
unsigned long  PeriodSecs 
)

Adds a single entry to list of batch entries.

Parameters
[in]hPumpValid pump handle
[in]TimeThe time that triggers first start of this dosage
[in]VolumeThe volume to dose
[in]FlowThe flow rate to use for dosage
[in]CyclesThe number of cycles to repeat this dosage. A value of 0 indicates an infinite repetition
[in]PeriodSecsThe time in seconds between two consecutive execution of this dosage batch entry
Returns
Error code - ERR_NOERR indicates success
long LCP_ClearBatchList ( dev_hdl  hPump)

Deletes all entries from a pumps batch list.

Parameters
[in]hPumpValid pump handle
Returns
Error code - ERR_NOERR indicates success
long LCP_GetBatchEntry ( dev_hdl  hPump,
unsigned long  Time,
dev_hdl pBatchEntryHdl 
)

This function returns a handle to a certain batch entry.

The functions searches for an entry with a certain starting time. The time value identifies the initial starting time.

Parameters
[in]hPumpValid pump handle
[in]TimeTime value (
See also
LCP_MakeTime())
Parameters
[out]pBatchEntryHdlHandle to the batch entry identified by Time param
Returns
Error code - ERR_NOERR indicates success
long LCP_GetBatchEntryAtIndex ( dev_hdl  hPump,
unsigned long  Index,
dev_hdl pBatchEntryHdl 
)

This function returns a handle to a certain batch entry.

To access the parameters of a batch entry, a valid batch entry handle is required. This handle can be obtained by this function

Parameters
[in]hPumpValid pump handle
[in]IndexIndex into internal array of batch entries
[out]pBatchEntryHdlHandle to the batch entry indexed by Index param
Returns
Error code - ERR_NOERR indicates success
Return values
-ERR_PARAM_RANGE- Index parameter is out of range (>= size of batch list)
Note
An index does not always identify the same batch entry. The batch entries a stored in a certain order and this order may change during execution or after insertion/deletion of entries
long LCP_GetBatchEntryParam ( dev_hdl  BatchEntryHdl,
double *  pVolume,
double *  pFlow,
unsigned long *  pTime,
unsigned long *  pCycles,
unsigned long *  pPeriodSecs 
)

This function returns the configuration of a certain batch entry.

Parameters
[in]BatchEntryHdlValid batch entry handle
[out]pVolumeReturns the volume value
[out]pFlowReturns the flow value
[out]pTimeReturns the first start time of this batch entry
[out]pCyclesReturns the number of cycles this batch entry should be executed
[out]pPeriodSecsReturns the period in seconds
Returns
Error code - ERR_NOERR indicates success
long LCP_GetBatchListSize ( dev_hdl  hPump)

Query current number of entries in a pumps batch list.

Parameters
[in]hPumpValid pump handle
Return values
>=0 Number of entries in batch list
<0Error code
long LCP_GetNextDosageTime ( dev_hdl  hPump)

Returns time of next dosage event.

Note
The function only returns a valid value if the batch is running (
See also
LCP_IsBatchRunning()). If the batch is not running, then the time value returned is undefined.
Parameters
[in]hPumpValid pump handle of pump to check
Return values
>=0Time value of next dosage event
<0Error code
long LCP_IsBatchRunning ( dev_hdl  hPump)

Check if batch processing is active.

Parameters
[in]hPumpValid pump handle of pump to check
Return values
0Batch processing is inactive
>0Batch processing is active
<0Error code - ERR_NOERR indicates success
long LCP_RemoveBatchEntry ( dev_hdl  hPump,
unsigned long  Time 
)

Remove batch entry from list of batch entries.

Parameters
[in]hPumpValid pump handle
[in]TimeIndicates the starting time of the batch entry to be removed
Returns
Error code - ERR_NOERR indicates success
long LCP_StartBatchProcessing ( dev_hdl  hPump)

Start processing of batch list.

Parameters
[in]hPumpValid pump handle of pump to start
Returns
Error code - ERR_NOERR indicates success
long LCP_StopBatchProcessing ( dev_hdl  hPump)

Stop processing of batch list.

Parameters
[in]hPumpValid pump handle of pump to stop
Returns
Error code - ERR_NOERR indicates success