...
The following example writes the value 0 to the hypothetical application specific object entry "[1234:56]" within the object directory of the CANopen node AppNode.
Code Block | ||
---|---|---|
| ||
CPU_INT32U value;
CO_OBJ *entry;
:
value = 0L;
entry = CODirFind (&(AppNode.Dir), CO_DEV(0x1234,0x56));
err = COObjWrValue (entry, &value, 4, 0);
: |
Note: The example shows a read access with the knowledge, that the addressed object entry is independent from the CANopen node-ID. To be independent from this knowledge, the API function CONmtGetNodeId()
may be used to get the current node ID.
...