Daxbot / node-canopen

CANopen implementation for NodeJS
MIT License
32 stars 11 forks source link

[2.5.3] RPDO communication parameters #22

Closed arkaheb258 closed 3 years ago

arkaheb258 commented 3 years ago

Fields "inhibitTime", "eventTime" and "syncStart" are not mandatory in RPDO. Example solution (src/protocol/pdo.js):

@@ -232,17 +232,17 @@ class Pdo {
         /* sub-index 3:
          *   bit 0..15      Inhibit time.
          */
-        const inhibitTime = entry[3].value;
+        const inhibitTime = (index >= 0x1800)?entry[3].value:0;

         /* sub-index 5:
          *   bit 0..15      Event timer value.
          */
-        const eventTime = entry[5].value;
+        const eventTime = (index >= 0x1800)?entry[5].value:0;

         /* sub-index 6:
          *   bit 0..7       SYNC start value.
          */
-        const syncStart = entry[6].value;
+        const syncStart = (index >= 0x1800)?entry[6].value:0;

         let pdo = {
             cobId:          cobId,
wilkinsw commented 3 years ago

Should be resolved in 2.5.4-beta