CANopen TX PDO
This block defines PDO mapping for transmitted messages.
Block ID
CANopen TX PDO
Library
motohawk_canopen_lib
Description

This block defines PDO mapping for transmitted messages.
COB ID Base value shall comply with CANopen specification :
- First 7 bits must always be set to '0'.
- If CAN ID type in the CANopen instance is set to standard only 0x180, 0x200, 0x280, 0x300, 0x380, 0x400, 0x480 and 0x500 are allowed
- If CAN ID type in the CANopen instance is set to extended 0x180, 0x200, 0x280, 0x300, 0x380, 0x400, 0x480, 0x500 and any value equal or greater than 0x800 are allowed
TX PDO script definition
TX PDO must be defined by following structure format :
| pdodb.name | = | 'TPDO_0'; |
| pdodb.description | = | 'TPDO example'; |
| pdodb.parameters.enable_pdo.data_source | = | 2; |
| pdodb.parameters.enable_pdo.data_default | = | true; |
| pdodb.parameters.enable_pdo.data_datastore_name | = | 'enable_ds'; |
| pdodb.parameters.node_id.data_source | = | 2; |
| pdodb.parameters.node_id.data_default | = | uint8(3); |
| pdodb.parameters.node_id.data_datastore_name | = | 'nodeid_ds'; |
| pdodb.parameters.sync_events_before_tx.data_source | = | 2; |
| pdodb.parameters.sync_events_before_tx.data_default | = | uint8(3); |
| pdodb.parameters.sync_events_before_tx.data_datastore_name | = | 'synctx_ds'; |
| pdodb.parameters.transmission_rate.data_source | = | 2; |
| pdodb.parameters.transmission_rate.data_default | = | int16(100); |
| pdodb.parameters.transmission_rate.data_datastore_name | = | 'Transmission_Rate_For_PDO_0'; |
| pdodb.fields{1}.data_od_entry_name | = | 'OD_1023_00'; |
| pdodb.fields{1}.start_bit | = | 0; |
| pdodb.fields{2}.data_od_entry_name | = | 'OD_1024_00'; |
| pdodb.fields{2}.start_bit | = | 16; |
| pdodb.fields{3}.data_od_entry_name | = | 'OD_2233_02'; |
| pdodb.fields{3}.start_bit | = | 32; |
| pdodb.fields{4}.data_od_entry_name | = | 'OD_2233_02'; |
| pdodb.fields{4}.start_bit | = | 48; |
Transmit PDO definition script examples are included with CANopen block set. The suggested arrangement is to have all TX PDO entries associated with the same CANopen instance in a single file. However it is possible to organize it differently as long as the resulting structure, which is used as a TX PDO Data Script definition, has the same format as the above example.
Description of script parameters (if not marked as optional the parameter is mandatory):
- name - unique name of TX PDO entry
- description - brief description, optional parameter
- parameters - necessary configuration parameters
- enable_pdo - enable PDO parameter
- data_source - source of enable PDO value
- 1 - constant value defined in data_default field
- 2 - port
- 3 - data store
- data_default - default value of enable PDO
- data_datastore_name - name of the data store where enable PDO is stored, only used when selected data_source is data store
- node_id - node ID of PDO message, value must be within the range of 1 - 127
- data_source - source of node ID value
- 1 - constant value defined in data_default field
- 2 - port
- 3 - data store
- data_default - default value of node ID
- data_datastore_name - name of data store where node ID is stored, only used when selected data_source is data store
- sync_events_before_tx - SYNC events before TX parameter. It is used only when selected transmission type is synchronous cyclical.
It defines how many SYNC events must occur before PDO is transmitted.
- data_source - source of SYNC events before TX
- 1 - constant value defined in data_default field
- 2 - port
- 3 - data store
- data_default - default value of SYNC events before TX, must be within the range of 1 - 240
- data_datastore_name - name of data store where SYNC events before TX is stored, only used when selected data_source is data store
- transmission_rate - Transmission rate parameter, value in milliseconds. It is only used when selected transmission type
is asynchronous manufacturer specific. It defines how often PDO message is transmitted. When 0 it is disabled.
When -1 it is sent periodically with rate inherited from containing subsystem.
- data_source - source of transmission rate
- 1 - constant value defined in data_default field
- 2 - port
- 3 - data store
- data_default - default value of node ID
- data_datastore_name - name of data store where node ID is stored, only used when selected data_source is data store
- enable_pdo - enable PDO parameter
- fields - describes PDO mapping
- data_od_entry_name - name of object dictionary entry
- start_bit - indicates where object dictionary entry value is placed in PDO frame
Block Parameters
| Parameter Field | Values | Comments/Description |
|---|---|---|
| CANopen Instance Reference | String | Name of associated CANopen instance definition. |
| COB-ID Base | Numeric | COB-ID Base value. |
| Transmission Type | Drop down | |
| Data Script definition | String | Evaluates to TX PDO definition specified in the example script. |
