Ucs_Return_t Ucs_Ns_Run | ( | Ucs_Inst_t * | self, |
Ucs_Rm_Node_t * | node_ptr, | ||
Ucs_Ns_ResultCb_t | result_fptr | ||
) |
Runs the script(s) contained in the given node.
The function starts the process to transmit the script(s) contained in the given node and checks for the expected results (specified by customer). The Node Scripting module will start a timer of 2600ms before sending the Tx command of each script. That is, if no incoming messages match the expected result of the script during this time the result code UCS_NS_RES_ERROR is returned via the Ucs_Ns_ResultCb_t user callback function. This error code is also get when the script module couldn't perform the device synchronization of the remote device. Otherwise, if an incoming message matches the expected result, UCS_NS_RES_SUCCESS is returned.
The function will return UCS_RET_ERR_API_LOCKED when attempting to execute a script in a node that is currently busy with other(s) previous script(s). Ucs_Ns_Run() is namely locked for a Node when running script(s) on this node and unlocked after reporting the operation's result. However processing scripts can be executed on different nodes in parallel.
self | The UNICENS instance |
node_ptr | Reference to the node instance. |
result_fptr | Reference to the result function pointer |
Value | Description |
---|---|
UCS_RET_SUCCESS | No error |
UCS_RET_ERR_NOT_AVAILABLE | No internal resources allocated for the given node. Check if value of UCS_NUM_REMOTE_DEVICES is less than the current number of remote devices in network. |
UCS_RET_ERR_PARAM | At least one parameter is NULL. |
UCS_RET_ERR_NOT_INITIALIZED | UNICENS is not initialized |
UCS_RET_ERR_BUFFER_OVERFLOW | No TxBuffer Handles available |
UCS_RET_ERR_API_LOCKED | The API is locked. |
Example