This subroutine converts a point value from engineering units to the raw value. This function is necessary for those applications that accept (or compute) a point value in engineering units format and need to download that point to a PLC as a RAW value. This is the normal scenario for points that have engineering units conversion. Point values are sent to and received from point management as integers, and are converted to or from engineering units (floating point values) by the application.
If the point is configured with CUSTOM conversion, you must configure a Reverse expression for the point.
If the point is configured with LINEAR conversion, a Reverse expression is automatically created for the point.
Synopsis
int PTMAP_rev_eu_conv ( point_id, eu_value, result,
ret_stat )
char *point_id;
double eu_value;
PTM_DATA **result;
COR_STATUS *ret_stat;
Input Arguments
point_id |
Point identifier for conversion. |
eu_value |
The floating-point value for conversion. |
Output Arguments
Result |
A pointer to the address of a PTM_DATA struct that will receive the result of the computation. |
|
For example, result = PTMAP_alloc_eu_data. |
eu_label |
Engineering units string from configuration data. |
Retstat |
Pointer to status structure. The following errors may be returned (see Appendix A for an explanation of this code): |
|
PTMAP_INVAL_POINT_ID |
|
PTMAP_HAS_NOT_EU_CONV |
Return Value
The contents of retstat.status.
Point Management API subroutines. |