CANopen RX PDO
This block defines PDO mapping for received PDO messages.
Block ID
CANopen RX PDO
Library
motohawk_canopen_lib
Description

This block defines PDO mapping for received 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
RX PDO script definition
RX PDO must be defined by following structure format :
| pdodb.name | = | 'RPDO_0'; |
| pdodb.description | = | 'RPDO 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.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; |
Receive PDO definition script examples are included with CANopen block set. The suggested arrangement is to have all RX PDO entries associated with the same CANopen instance in a single file. However it is possible to organize it differently as long as resulting structure, which is used as a RX PDO Data Script definition, has the same format as the above example.
Description of script parameters (if not marked as optional parameter is mandatory):
- name - unique name of RX PDO entry
- description - brief description, optional parameter
- parameters - mandatory 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 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
- 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 RX PDO definition specified in the example script. |
