DrvIntDp
A class for a driver internal DP interface. This class should simplify the handling of internal data points in a driver. It must be overloaded for each internal data point. The overloading class must give the number of data point elements to handle (maxDp) and the number of data point elements for a dpConnect (maxConnect). The first maxConnect entries are the entries, where a dpConnect is executed, so getDpName4Query must return the names for dpConnect first! The class does the retrieval of data point IDs via SYS_MSG_NAMESERVER. It executes the dpConnect for the data point elements which should be connected. It calls virtual functions in the case the answer or a hotlink has been received. Note that such objects must be created after the DrvRsrce object!
This class supplies the following methods:
-
DrvIntDp(int maxDp, int maxConnect): allocates the array for the DP table and inserts the object into the list managed in the DrvRsrce class.
Parameters:
maxDp - Number of data point elements.
maxConnect - Number of data point elements to connect to.
-
~DrvIntDp(): Deletes the array and removes the object from the DrvRsrce class list.
-
virtual const CharString& getDpName4Query(int index): Retrieves the names of the internal data point elements. This function must be overloaded. It should return the proper data point element string for the corresponding index.
-
virtual void answer4DpId(int index, Variable* varPtr): This function is called if there is an answer to the dpConnect for a certain index.
Parameters:
index - Index of the data point element .
varPtr - Pointer to the variable object.
-
virtual void hotLink2Internal(int index, Variable* varPtr) : This function is called if there is a hotlink for a certain index.
Parameters:
index - Index of the data point element.
varPtr - Pointer to the variable object.
-
virtual void dpReady() : This function is called if the internal data point object is ready initialized.
-
DrvIntDpState_t getState() const : function to retrieve the actual state of the internal data point interface object. This function can be used to check if the internal data point has been properly initialized.
-
bool getError() const : Access function returning the error state of the internal data point interface.
-
const DpIdentifier& getId(int index) : Function to retrieve the data point ID (DPID) for a certain index.