EtherNet/IP™ Adapter  1.04.06
User Reference Manual

◆ EI_API_CIP_setAttr_shortstring()

uint32_t EI_API_CIP_setAttr_shortstring ( T pCipNode_p,
uint16_t  classId_p,
uint16_t  instanceId_p,
uint16_t  attrId_p,
ei_api_cip_edt_shortstring *  pAttrValue_p 
)

Set attribute of type SHORT_STRING.

This function sets the attribute value of the CIP specified elementary data type SHORT_STRING. If the operation is completed successfully, the function returns EI_API_CIP_eERR_OK, else an error code.

Parameters
[in]pCipNode_pPointer to the CIP node.
[in]classId_pClass identifier.
[in]instanceId_pInstance identifier.
[in]attrId_pAttribute identifier.
[in]pAttrValue_pThe new attribute value as a NULL terminated C string (\0).
Returns
EI_API_CIP_EError_t as uint32_t value.
Return values
EI_API_CIP_eERR_OKSuccess.
EI_API_CIP_eERR_NODE_INVALIDCIP node is invalid, possibly EI_API_CIP_NODE_new() was not called.
EI_API_CIP_eERR_CLASS_DOES_NOT_EXISTClass does not exists in CIP node dictionary.
EI_API_CIP_eERR_INSTANCE_DOES_NOT_EXISTInstance does not exist in CIP node dictionary.
EI_API_CIP_eERR_ATTRIBUTE_DOES_NOT_EXISTAttribute does not exist in class or instance.
EI_API_CIP_eERR_ATTRIBUTE_INVALID_VALUEInvalid data pointer.
EI_API_CIP_eERR_ATTRIBUTE_INVALID_TYPEAttribute type is invalid.
EI_API_CIP_eERR_ATTRIBUTE_UNKNOWN_STATEUnknown state during attribute operation reached.
Example
uint32_t errCode;
// elementary data type SHORT_STRING
ei_api_cip_edt_shortstring attrShortStringValue[] = "Hello short string";
// set attribute with identifier 0x0007 from class 0x0026 and instance 0x0002 to "Hello short string"
errCode = EI_API_CIP_setAttr_shortstring(pEI_API_CIP_NODE, 0x0026, 0x0002, 0x0007, attrShortStringValue);
See also
ei_api_cip_edt_shortstring, EI_API_CIP_getAttr_shortstring
EI_API_CIP_setAttr_shortstring
ETHIP_API uint32_t EI_API_CIP_setAttr_shortstring(T *pCipNode_p, uint16_t classId_p, uint16_t instanceId_p, uint16_t attrId_p, ei_api_cip_edt_shortstring *pValue_p)
Set attribute of type SHORT_STRING.
Definition: EI_API_CIP_main.c:4806