PISO-CPM100(U) / PCM-CPM100 user manual (ver. 2.02) Dec/03/2012 ----------------- 62
4.5.28. CPM100_PDOWrite
Description:
Call the function CPM100_PDOWrite to send out a PDO message to
the specified slave device. Before using this function, users need to use the
function CPM100_InstallPDO to install the PDO object into CPM100 if users
want to use non-default PDO. Then, change the NMT state of the target
slave device to operational mode by using the function
CPM100_NMTChangeState if the slave is not in the operational mode. Use
the parameter offset to set the start position of the PDO data, and use the
parameters “*TData” and “DLen” to point the data and data length. Then, this
function will follow the data length to cover the slave PDO buffer of the
CPM100 with the data from the specified start position, and send the data to
the specified slave via PDO protocol at the same time.
Syntax:
WORD
CPM100_PDOWrite (
BYTE
BoardNo,
WORD
Cobid,
BYTE
Offset,
BYTE
DLlen,
BYTE
*TData,
BYTE
BlockMode)
Parameter:
BoardNo:
[input] CPM100 board number (0~7).
Cobid:
[input] COB-ID used by the PDO object.
Offset:
[input] The start byte position of PDO data (0 ~ 7).
DLen:
[input] data size (dlen
+
offset
≦
8 (total length of the PDO).
*TData:
[output] The data pointer point to the PDO data.
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” and “Cobid” again. If
the procedure is still not complete, it will return “CPM_Wait”.