Cloud-Automation / node-soem

Simple Open EtherCAT Master (SOEM) Port for Node.js
18 stars 9 forks source link

passing/checking wrong number for OP State #10

Open tadibatt opened 7 years ago

tadibatt commented 7 years ago

In example_01.js and readme.md to switch to OP state we should pass to writeState/statecheck '8' and not '4'. See typdef enum from https://github.com/OpenEtherCATsociety/SOEM/blob/master/soem/ethercattype.h : /** Possible EtherCAT slave states */ typedef enum { /** No valid state. */ EC_STATE_NONE = 0x00, /** Init state*/ EC_STATE_INIT = 0x01, /** Pre-operational. */ EC_STATE_PRE_OP = 0x02, /** Boot state*/ EC_STATE_BOOT = 0x03, /** Safe-operational. */ EC_STATE_SAFE_OP = 0x04, /** Operational */ EC_STATE_OPERATIONAL = 0x08, /** Error or ACK error */ EC_STATE_ACK = 0x10, EC_STATE_ERROR = 0x10 } ec_state; and https://infosys.beckhoff.com/index.php?content=../content/1031/tcsystemmanager/reference/ethercat/html/EtherCAT_Diagnostics.htm&id= (section Info Data). Or I'm missing something ?

stefanpoeter commented 7 years ago

Don't know why it is the way it is, I guess it worked when I first used it. Your proposal seems right.