beautypg.com

6 callback functions: receive pdo, Initialization of callback functions: receive pdo, Callback functions: receive pdo – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 243

background image

13.5

13.6

Maestro

Software Manual

Node DS301 Command Reference

MAN-MASSW (Ver. Q)

Initialization of Callback Functions: Receive PDO

This function implements initialization of PDO callback (@pdo).

Syntax:

.listenpdo(enablePDO1,

enablePDO2,

enablePDO3,

enablePDO4)

Input Parameters:

enablePDO1 – get PDO1 Transmit data from the CAN node

enablePDO2 – get PDO2 Transmit data from the CAN node

enablePDO3 – get PDO3 Transmit data from the CAN node

enablePDO4 – get PDO4 Transmit data from the CAN node

Return Value:

None

Example:

See the Callback Functions Receive PDO example below.

Callback Functions: Receive PDO

This function implements PDO handler calls and sends a new PDO Transmit message.

Syntax:

function @pdo(int address, int wData, int lData, int length)

Input Parameters:

Address – bit field consists of the following:

busId = address & 0x0100 (0 or 1)

nodeId = address & 0x00FF (1–127)

pdoNum = address >> 16 (1,2, 3 or 4)

wData – high 32 bits of PDO data

lData – low 32 bits of PDO data

length – PDO data length (in bytes)

Return Value:

None

13-3