Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

CODirWrWord

Description

This function writes a 16bit value to the given object directory. The object entry is addressed with the given key.

Prototype

CPU_INT16S CODirWrWord(CO_DIR *cod, CPU_INT32U key, CPU_INT16U val);

ParameterMeaning
cod pointer to the CANopen object directory
key object entry key; should be generated with the macro CO_DEV()
value the source value

Returned Value

 = CO_ERR.NONE  Successful operation

!= CO_ERR.NONE  An error is detected (see section "Error Identification")

Example

The following example writes the value to the hypothetical application specific object entry "[1234:56]" within the object directory of the CANopen node AppNode.

Note: This function uses CODirFind() on each function call. To improve access performance for multiple accesses to a single object entry, the application may use CODirFind() once and COObjWrValue() multiple times.

End of topic

  • No labels