IoT::CANopen

class MPDO

File Information

Library: IoT/CANopen
Package: CANopen
Header: IoT/CANopen/MPDO.h

Description

This class implements the CANopen MPDO (Multiplex Process Data Object) protocol.

Member Summary

Member Functions: addCOBIDs, onFrameReceived, removeCOBIDs, transmitMPDO

Nested Classes

struct MPDOTransfer

 

Enumerations

AddressType

MPDO addressing mode.

MPDO_SAM = 0

Source Address Mode

MPDO_DAM = 1

Destination Address Mode

Constructors

MPDO

MPDO(
    CANBus & canBus,
    Poco::UInt8 nodeID
);

Creates the PDO object using the given CANBus object. The node ID of this node must be given. If a node ID of 0 is given, all MPDOs are reported. Otherwise, only MPDOs targetted at the given node are reported.

Destructor

~MPDO

~MPDO();

Destroys the Time object.

Member Functions

addCOBIDs

void addCOBIDs(
    Poco::UInt32 firstCOBID,
    Poco::UInt32 count = 1
);

Adds a range of COB-IDs to the internal set of COB-IDs for receiving MPDOs.

removeCOBIDs

void removeCOBIDs(
    Poco::UInt32 firstCOBID,
    Poco::UInt32 count = 1
);

Removes a range of COB-IDs from the internal set of COB-IDs for receiving MPDOs.

transmitMPDO

void transmitMPDO(
    Poco::UInt32 cobID,
    AddressType addrType,
    Poco::UInt8 nodeID,
    Poco::UInt16 index,
    Poco::UInt8 subIndex,
    Poco::UInt8 size,
    const char * data
);

Transmits a MPDO.

onFrameReceived protected

void onFrameReceived(
    const CANFrame & frame
);

Handles MPDO frames.

Variables

mpdoReceived

Poco::BasicEvent < const MPDOTransfer > mpdoReceived;

Fired when a PDO has been received.

Securely control IoT edge devices from anywhere   Connect a Device