PISO-CPM100(U) / PCM-CPM100 user manual (ver. 2.02) Dec/03/2012 ----------------- 52
4.5.18.
CPM100_ScanNode
Description:
User can use the function CPM100_ScanNode to know how many
slave nodes are on the CANopen network.
Syntax:
WORD
CPM100_ScanNode(
BYTE
BoardNo,
BYTE
S_Node,
BYTE
E_Node,
BYTE
*NodeList,
BYTE
BlockMode)
Parameter:
BoardNo:
[input] CPM100 board number (0~7).
S_Node:
[input] Start node ID.
E_Node:
[input] End node ID. This function will scan node ID from
S_Node to E_Node. If S_Node >= E_Node, it will scan
all slave node ID (1 ~ 127) on the CANopen network.
*NodeList:
[output] This is a 16-byte array parameter. Each bit of the
parameter means a node ID, the bit is 0 means that the
node ID doesn’t exist and 1 means the node ID is on
the CANopen network. For example, if the NodeList[0]
is 0x16 (0001 0110), it means that the nodes with ID 1,
2, and 4 exist, and the nodes with ID 0, 3, 5, 6, and 7
don’t exist. If the NodeList[1] is 0x41 (0100 0001), it
means that the nodes with ID 8 and 14 exist, and the
nodes with ID 9, 10, 11, 12, 13, and 15 don’t exist.
BlockMode:
[input] 0 means this function is non-block-function, and 1
means this function is block-function. If set this parameter to 1, the
running procedure of the users’ application will be held in the
function until return. If set to 0, this function will return “CPM_
Processing” directly. This function will return its process status
while users apply it with the same “BoardNo” again. If the
procedure is still not complete, it will return “CPM_Wait”.