CONmtSetNodeId
Description
This function sets the requested CANopen Node-ID within the NMT module.
...
If one of these errors is detected, this function call will change nothing.
Important: After successful operation, the function CONmtReset()
must be called to re-initialize the internal SDO and PDO tables.
Example
The following example shows how to set a dynamically determined node-ID for the CANopen node AppNode:End of topic
Code Block | ||
---|---|---|
| ||
CO_ERR err;
CPU_INT08U id;<br> :
id = <code>AppCalculateNodeId()</code>;
CONmtSetNodeId (&(AppNode.Nmt), id);
err = CONodeGetErr(&AppNode);
if (err == CO_ERR_NONE) {
/* calculated node-ID is set */
} else {
/* error during setting the node-ID */
}
: |