pdcomm_gem_equipment_data_get
Function
Copies the name, units, or cached value of one data variable.
PdcommStatus pdcomm_gem_equipment_data_get(PdcommTcpEndpoint *endpoint, uint32_t id, uint32_t field, PdcommSecsItem **out_item)#PDCOMM_GEM_DATA_NAME and #PDCOMM_GEM_DATA_UNITS return owned ASCII items. #PDCOMM_GEM_DATA_CACHED returns an owned copy of the cached value, or #PDCOMM_OK with *out_item NULL when no value is cached.
Parameters
| Name | Description |
|---|---|
endpoint | Equipment endpoint. |
id | Data variable ID (DVID). |
field | #PDCOMM_GEM_DATA_NAME, #PDCOMM_GEM_DATA_UNITS, or #PDCOMM_GEM_DATA_CACHED. |
out_item | Receives the new item; set to NULL first. Must not be NULL. |
Returns
#PDCOMM_OK on success (including an empty cache); #PDCOMM_INVALID_ARGUMENT when endpoint or out_item is NULL or field is unknown; #PDCOMM_OUT_OF_RANGE when id is not defined; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment or has no data store; #PDCOMM_BACKPRESSURE, #PDCOMM_LIMIT_EXCEEDED, #PDCOMM_ALLOCATION_FAILED, or #PDCOMM_POISONED.
Notes
- Ownership: release the item with pdcomm_secs_destroy(). It is independent of later store changes and of the endpoint.