Cloud-Automation / node-soem

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

slaves[0] is now first slave found (not master) #1

Closed jonwooding closed 7 years ago

jonwooding commented 7 years ago

I noticed that node-soem could not correctly populate the slaves[0].name field via getSlaves (as well as configaddr, etc.). It seems that your call to getSlaves was referencing ec_slave[i] from 0 to ec_slavecount-1, I have changed this to go from 1 to ec_slavecount and put each slave in slaves[i-1]. I have not tested this on multiple slaves but it works fine for a single slave. I will test on multiple slaves when my next slave device arrives.

stefanpoeter commented 7 years ago

Thanks :-)