我试图通过仅将 unsigned32 数据的前两个字节映射到 PDO 来执行 CANopen PDO 映射。是否可以这样做以及如何做?
我得到了错误代码 0604 0041(这意味着 PDO 无法映射)用于执行上述映射。
我试图通过仅将 unsigned32 数据的前两个字节映射到 PDO 来执行 CANopen PDO 映射。是否可以这样做以及如何做?
我得到了错误代码 0604 0041(这意味着 PDO 无法映射)用于执行上述映射。
First, check that the parameter is mappable. If you have the EDS file, the parameter of interest has PDOMapping=1
.
If the parameter is mappable, you should be able set one of the mapping variables for the PDO to an encoded UNSIGNED32 Idx{16-bit}, Sidx{8-bit}, nbits{8-bit}. For example, if you wanted to encode 2000,05 as the first parameter of the first TPDO, set 1A00,01
to 0x20000510
.
I forgot to ask:
If your system refused to map the PDO entry because the size did not match, I would expect the system to report error 0x06040042
(number/length of objects exceed PDO size) when setting subindex 0 at the end of the mapping procedure.
I believed it was possible to map smaller pieces of an object dictionary entry. I rechecked CiA-301, and it seems silent on the issue other than to say the length is mandatory.