jgeisler0303 / CANFestivino

Arduino Library Version of CANFestival CANopen Stack
GNU Lesser General Public License v2.1
51 stars 17 forks source link

PDO triggering events #9

Open alessio31183 opened 7 years ago

alessio31183 commented 7 years ago

How is the PDO transmission managed?

Event- or timer-driven: A device-internal event triggers the PDO transmission (e.g. when the temperature value exceeds a certain limit; event-timer elapses; etc.).

Remotely-requested: As PDOs consist of a single CAN data frame, they can be requested via remote transmission request (RTR).

Synchronous transmission (cyclic): The transmission of the PDO can be coupled to the reception of the SYNC message.

Synchronous transmission (acyclic): These PDOs are triggered by a defined device-specific event but transmitted with the reception of the next Sync message.

jgeisler0303 commented 7 years ago

You can set the transmission type to your liking via SDO address 180x sub 02. See here for what the numbers mean: http://www.canopensolutions.com/english/about_canopen/pdo.shtml

Basically 255 or 254 means: event based. 0...240 means: on sync message received. The RTR request types should not be uses any more.

If you want timer based transmission set transmission type to 254 and timer value to >0. If you want a transmission whenever the value changes (or changes by a certain amount) you need to set transmission type to 254 and call ObjDict_PDO_status[number_of_PDO_in_which_this_data_is_sent].event_trigger= 1; sendOnePDOevent(number_of_PDO_in_which_this_data_is_sent); by yourself!

BTW: the AGCON_B1 example is a basement ventilation control device with humidity sensors, window openers and fan switches.

alessio31183 commented 7 years ago

A very helpful link. Thanks