A6 Ethercat - digital IO mapping?

  • spumco
  • Away
  • Platinum Member
  • Platinum Member
More
24 May 2026 18:15 #346584 by spumco
A6 Ethercat - digital IO mapping? was created by spumco
Just dipping my toe in the ethercat waters and trying to set up a single drive on the bench.

I've got LCNC talking to the drive, and can start LCNC with a basic 1-axis config.  Very exciting to see the position change when I twist the motor shaft.  Much thanks to the forum!

Next move is to enable/configure the drive's IO, but none of the various xml file examples I could find in the forum appear to have mapped DI1-DI5 & DO1-DO3 to HAL pins.

I'd like to use all the DI/DO as general purpose IO (other than DO3 for a brake).  Does anyone have an xml file with all the IO defined and mapped?

And whatever else I need, maybe a HAL file with IO pin names?

Thanks for any examples or suggestions.

Please Log in or Create an account to join the conversation.

More
25 May 2026 01:57 #346591 by Rookie0
Replied by Rookie0 on topic A6 Ethercat - digital IO mapping?
It can be done this way, but my approach is to use the IO module separately.
The advantage is that there is no need to connect wires from CN1 of the servo driver, as connecting only one driver is actually insufficient. There are more endpoints on the IO module.

Please Log in or Create an account to join the conversation.

  • spumco
  • Away
  • Platinum Member
  • Platinum Member
More
25 May 2026 02:35 #346592 by spumco
Replied by spumco on topic A6 Ethercat - digital IO mapping?

connecting only one driver is actually insufficient


Sufficient for whose purpose? Yours or mine?

I'm not trying to get a specific machine working...I'm trying to get the driver's IO controllable via HAL.

I don't understand exactly how the xml file's in/out configuration works and I can't find an example I can use as a template.

Please Log in or Create an account to join the conversation.

More
25 May 2026 02:42 #346593 by Rookie0
Replied by Rookie0 on topic A6 Ethercat - digital IO mapping?
You can obtain the PDO corresponding to IO by consulting the servo's manual, and then add it to the ethercat-config.xml file. The "bitslice" component may be required in the hal file.
I have tested it with Leadshine's servo before and it worked normally, but I didn't save the configuration file.

Please Log in or Create an account to join the conversation.

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
25 May 2026 03:44 #346594 by rodw
Replied by rodw on topic A6 Ethercat - digital IO mapping?
Not your drive but this XML shows you how to set the input type using sdoconfig
github.com/rodw-au/linuxcnc-cia402/blob/main/ethercat-conf.xml

Please Log in or Create an account to join the conversation.

  • spumco
  • Away
  • Platinum Member
  • Platinum Member
More
25 May 2026 03:48 #346595 by spumco
Replied by spumco on topic A6 Ethercat - digital IO mapping?
Forgive me for being extremely new at this.

I understand 'add it to the xml file' in general terms, but as I have no experience or context it's hard for me to determine exactly what/how to add something.

My test xml file has what appears to be variable PDOs: "pdo idx=1600" and pdo idx="1A00"

These appear to be variable PDOs, whatever that means, based on the chart taken from the manual:
 

However, the only place where digital outputs appear to be available is in the Fixed PDO section:
 

Can I add another section in the xml file for fixed PDO's? or do I have to pick one or the other?

Regarding bitslice... am I correct - generally - in that the drive sends a 'word' or string or something to LCNC with address "60FDh", and the value of that word can be interpreted using bitslice as the status of the drive's digital inputs?

If so, using the chart below is the key needed to configure bitslice in to HAL pins?
 
 
Attachments:

Please Log in or Create an account to join the conversation.

  • spumco
  • Away
  • Platinum Member
  • Platinum Member
More
25 May 2026 15:59 #346608 by spumco
Replied by spumco on topic A6 Ethercat - digital IO mapping?
Got the inputs figured out.

1.  Program drive so all inputs are 'no function assigned'

2. Change xml input address HAL name:
<pdoEntry idx="60FD" subIdx="00" bitLen="32" halPin="digitalinputs" halType="u32"/>

3. Add bitslice to HAL, using the bit chart from the servo manual:
loadrt bitslice count=1 personality=32
addf    bitslice.0              servo-thread    #DRIVE IO

net DI-X-IN     <=  lcec.0.A6.digitalinputs
net DI-X-IN     =>  bitslice.0.in

net DI-X-IN-16  <=  bitslice.0.out-16
net DI-X-IN-17  <=  bitslice.0.out-17
net DI-X-IN-18  <=  bitslice.0.out-18
net DI-X-IN-19  <=  bitslice.0.out-19
net DI-X-IN-20  <=  bitslice.0.out-20

Now I can press buttons connected to the drive and all five inputs react in halshow.  Rather exciting...

Next step is to see if I can fumble through changing the PDOs to 'fixed' and somehow map the outputs.

Anyone have a clue what 'sub-index 1' means?
 
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
25 May 2026 21:47 #346626 by rodw
Replied by rodw on topic A6 Ethercat - digital IO mapping?
You don't need bitslice, just do it in the xml
<pdoEntry idx="60FD" subIdx="0" bitLen="32" halType="complex">
            <complexEntry bitLen="1" halPin="CW-limit" halType="bit"/>
            <complexEntry bitLen="1" halPin="CCW-limit" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-home" halType="bit"/>
            <complexEntry bitLen="13"/>
            <complexEntry bitLen="1" halPin="in-1" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-2" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-3" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-4" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-5" halType="bit"/>
            <complexEntry bitLen="1" halPin="in-6" halType="bit"/>
            <complexEntry bitLen="10"/>
          </pdoEntry>       
 NOte there are some unused bits in this example
The following user(s) said Thank You: spumco

Please Log in or Create an account to join the conversation.

  • spumco
  • Away
  • Platinum Member
  • Platinum Member
More
25 May 2026 22:12 #346628 by spumco
Replied by spumco on topic A6 Ethercat - digital IO mapping?
Thanks Rod, I found another example - which pointed me to your GH example.  I've now got the XML and HAL configured like your example, and evern figured out how to use the "sub-index" stuff.

Remaining problem is that the manual is missing the bit values for digital outputs.

There's no corresponding chart or description for index 60FE like there is for the inputs.

I can 'talk' to the 60FEh address and write values - and see them change in the tuning software - but I've no idea what values turn on/off the outputs.

 

Based on the two output-related sub-indexes I'm also wondering if there's some requirement to first enable the outputs, then activate them.

I checked the OEM servo manufacturer's manual and no luck (JSS servos - JSS715N).

I tried bits 1 & 2, as well as bits 16 & 17 - based on the now-obsolete T7/leadshine servos.  Wild chance, but no dice.

Also tried turning both sub-indexes on, still no joy.

I've emailed Stepperonline, no response yet.

Anyone have a suggestion?
Attachments:

Please Log in or Create an account to join the conversation.

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
25 May 2026 22:34 - 25 May 2026 22:36 #346629 by rodw
Replied by rodw on topic A6 Ethercat - digital IO mapping?
type:
ethercat pdos > pdos.txt
ethercat sdos > sdos.txt
and share the output here.

Probably something like
<pdoEntry idx="60FE" subIdx="1" bitLen="16" halType="complex">
<complexEntry bitLen="1" halPin="out-1" halType="bit"/>
<complexEntry bitLen="1" halPin="out-2" halType="bit"/>
<complexEntry bitLen="14"/>
</pdoEntry>


also adapted from my GitHub example
 
Last edit: 25 May 2026 22:36 by rodw.

Please Log in or Create an account to join the conversation.

Time to create page: 0.193 seconds
Powered by Kunena Forum