The hardware identifier is provided by the device configuration of CM CANopen:
I suggest using the name: “Local~CM_CANopen_1” as a global system constant that is automatically created by TIA Portal .
Also, reduce the CAN baudrate to 250kBaud because the CM CANopen can lose received CAN frames when the CAN baudrate is 500 kBaud or higher.
Here is a transparent CAN demo (TIA V13) that can be imported in the newest TIA versions.
This demo is based on a revised library that has solved some bugs (e.g.: the data type of the hardware identifier) and that has improved performance.
Note that the FBs use an interface that is different from the description in the manual.
Make sure to read the description of the transparent CAN demo before starting.
Transparent CAN Demo.zip (6.1 MB)
CM CANopen Function Blocks V13 Ver. 2.0.0.zip (1.2 MB)