General Questions about using ethercat
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 595
- Thank you received: 188
20 Mar 2025 07:35 #324345
by Hakan
Replied by Hakan on topic General Questions about using ethercat
If you got an xml file from the manufacturer it is most likely an ESI file. Linuxcnc doesn't use that.
Linuxcnc reads out all necessary info from the drive itself. You can see most of that info yourself with the commands
You do need to connect pdos to hal pins and that is (mostly) what you do in the linuxcnc ethercat-conf.xml file.
A good starting point for that is often the output from the "lcec_configgen" command.
Which happens to use the three commands above and rearranges that info into a workable ethercat-conf.xml that you can then modify if needed and you don't like the naming etc.
I wonder how one can describe the configuration of a linuxcnc ethercat system. There isn't any stepconf or pncconf and it isn't realistic to create one due to the large variety and number of devices. I hope to get proven wrong there.
Starting point is a linuxcnc config from the linuxcnc simulator examples and then substitute pins.
lcec and ethercat-conf.xml, how to create the ethercat-conf.xml
Special on Cia402 drives
Modifications to hal
Linuxcnc reads out all necessary info from the drive itself. You can see most of that info yourself with the commands
ethercat pdos
ethercat sdos
ethercat -v slaves
You do need to connect pdos to hal pins and that is (mostly) what you do in the linuxcnc ethercat-conf.xml file.
A good starting point for that is often the output from the "lcec_configgen" command.
Which happens to use the three commands above and rearranges that info into a workable ethercat-conf.xml that you can then modify if needed and you don't like the naming etc.
I wonder how one can describe the configuration of a linuxcnc ethercat system. There isn't any stepconf or pncconf and it isn't realistic to create one due to the large variety and number of devices. I hope to get proven wrong there.
Starting point is a linuxcnc config from the linuxcnc simulator examples and then substitute pins.
lcec and ethercat-conf.xml, how to create the ethercat-conf.xml
Special on Cia402 drives
Modifications to hal
Please Log in or Create an account to join the conversation.
- Tntmold
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
20 Mar 2025 14:38 #324358
by Tntmold
Replied by Tntmold on topic General Questions about using ethercat
please see attached files
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 595
- Thank you received: 188
20 Mar 2025 14:44 #324360
by Hakan
Replied by Hakan on topic General Questions about using ethercat
That xml file is an ESI file. It will not work. See my reply above.
Run "lcec_configgen" and put the output into ethercat-conf.xml.
Run "lcec_configgen" and put the output into ethercat-conf.xml.
Please Log in or Create an account to join the conversation.
- Tntmold
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
20 Mar 2025 14:52 #324361
by Tntmold
Replied by Tntmold on topic General Questions about using ethercat
I am way to ignorant on linuxcnc to understand what to do next. They are cia402 drives (Lichuan OL3-E57H) as I have two of them I have started with a lathe config as shown on the first video of this thread. How is the ESI file different from what linuxcnc needs? Should I be using output from pdos as my xml file?
phil@SodickA:~/linuxcnc/configs/sim.axis$ ethercat pdos
=== Master 0, Slave 0 ===
SM0: PhysAddr 0x1000, DefaultSize 128, ControlRegister 0x26, Enable 1
RxPDO 0x1a01 "TxPDO 2"
PDO entry 0x603f:00, 16 bit, "ErrorCode"
PDO entry 0x6041:00, 16 bit, "StatusWord"
PDO entry 0x6064:00, 32 bit, "Position actual value"
PDO entry 0x60fd:00, 32 bit, "Digital inputs"
PDO entry 0x6061:00, 8 bit, "Modes of operation display"
RxPDO 0x1601 "RxPDO 2"
PDO entry 0x6040:00, 16 bit, "ControlWord"
PDO entry 0x6060:00, 8 bit, "Modes of operation"
PDO entry 0x607a:00, 32 bit, "Target position"
PDO entry 0x6081:00, 32 bit, "Profile velocity"
PDO entry 0x6099:01, 32 bit, "Search Switch"
PDO entry 0x6099:02, 32 bit, "Search Zero"
SM1: PhysAddr 0x1100, DefaultSize 128, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1200, DefaultSize 12, ControlRegister 0x64, Enable 1
RxPDO 0x1600 ""
PDO entry 0x6040:00, 16 bit, ""
PDO entry 0x607a:00, 32 bit, ""
PDO entry 0x60ff:00, 32 bit, ""
PDO entry 0x6060:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
SM3: PhysAddr 0x1300, DefaultSize 19, ControlRegister 0x20, Enable 1
TxPDO 0x1a00 ""
PDO entry 0x6041:00, 16 bit, ""
PDO entry 0x6064:00, 32 bit, ""
PDO entry 0x606c:00, 32 bit, ""
PDO entry 0x6061:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
=== Master 0, Slave 1 ===
SM0: PhysAddr 0x1000, DefaultSize 128, ControlRegister 0x26, Enable 1
RxPDO 0x1a01 "TxPDO 2"
PDO entry 0x603f:00, 16 bit, "ErrorCode"
PDO entry 0x6041:00, 16 bit, "StatusWord"
PDO entry 0x6064:00, 32 bit, "Position actual value"
PDO entry 0x60fd:00, 32 bit, "Digital inputs"
PDO entry 0x6061:00, 8 bit, "Modes of operation display"
RxPDO 0x1601 "RxPDO 2"
PDO entry 0x6040:00, 16 bit, "ControlWord"
PDO entry 0x6060:00, 8 bit, "Modes of operation"
PDO entry 0x607a:00, 32 bit, "Target position"
PDO entry 0x6081:00, 32 bit, "Profile velocity"
PDO entry 0x6099:01, 32 bit, "Search Switch"
PDO entry 0x6099:02, 32 bit, "Search Zero"
SM1: PhysAddr 0x1100, DefaultSize 128, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1200, DefaultSize 12, ControlRegister 0x64, Enable 1
RxPDO 0x1600 ""
PDO entry 0x6040:00, 16 bit, ""
PDO entry 0x607a:00, 32 bit, ""
PDO entry 0x60ff:00, 32 bit, ""
PDO entry 0x6060:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
SM3: PhysAddr 0x1300, DefaultSize 19, ControlRegister 0x20, Enable 1
TxPDO 0x1a00 ""
PDO entry 0x6041:00, 16 bit, ""
PDO entry 0x6064:00, 32 bit, ""
PDO entry 0x606c:00, 32 bit, ""
PDO entry 0x6061:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
phil@SodickA:~/linuxcnc/configs/sim.axis$ ethercat sdos
phil@SodickA:~/linuxcnc/configs/sim.axis$ ethercat -v slaves
=== Master 0, Slave 0 ===
Device: Main
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000a79
Product code: 0x00002000
Revision number: 0x00000001
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 0 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII up open yes - 1139426180 0 0
1 MII up open yes 1 1139427620 1440 720
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x0000/0, TX: 0x0000/0
Standard RX: 0x1000/128, TX: 0x1100/128
Supported protocols: CoE
General:
Group: EtherCAT Driver
Image name:
Order number:
Device name: OL3-E57H
CoE details:
Enable SDO: yes
Enable SDO Info: no
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: no
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 0 mA
=== Master 0, Slave 1 ===
Device: Main
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000a79
Product code: 0x00002000
Revision number: 0x00000001
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 720 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII down closed no 0 - - -
1 MII up open yes - 54668620 2396782160 0
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x0000/0, TX: 0x0000/0
Standard RX: 0x1000/128, TX: 0x1100/128
Supported protocols: CoE
General:
Group: EtherCAT Driver
Image name:
Order number:
Device name: OL3-E57H
CoE details:
Enable SDO: yes
Enable SDO Info: no
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: no
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 0 mA
phil@SodickA:~/linuxcnc/configs/sim.axis$ lcec_configgen
<masters>
<master idx="0">
<slave idx="0" type="generic" vid="0x00000a79" pid="0x00002000" name="D1">
<!--OL3-E57H-->
<syncManager idx="0" dir="out">
<pdo idx="1a01">
<!--TxPDO 2-->
<pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="BLANK"/>
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="statusword" halType="BLANK"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="position-actual-value" halType="BLANK"/>
<pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digital-inputs" halType="BLANK"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="modes-of-operation-display" halType="BLANK"/>
</pdo>
<pdo idx="1601">
<!--RxPDO 2-->
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="controlword" halType="BLANK"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="modes-of-operation" halType="BLANK"/>
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="target-position" halType="BLANK"/>
<pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="BLANK"/>
<pdoEntry idx="6099" subIdx="01" bitLen="32" halPin="search-switch" halType="BLANK"/>
<pdoEntry idx="6099" subIdx="02" bitLen="32" halPin="search-zero" halType="BLANK"/>
</pdo>
</syncManager>
<syncManager idx="1" dir="out"/>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="pin-6040-00" halType="BLANK"/>
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="pin-607a-00" halType="BLANK"/>
<pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="pin-60ff-00" halType="BLANK"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="pin-6060-00" halType="BLANK"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="pin-6041-00" halType="BLANK"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="pin-6064-00" halType="BLANK"/>
<pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="pin-606c-00" halType="BLANK"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="pin-6061-00" halType="BLANK"/>
</pdo>
</syncManager>
</slave>
<slave idx="1" type="generic" vid="0x00000a79" pid="0x00002000" name="D2">
<!--OL3-E57H-->
<syncManager idx="0" dir="out">
<pdo idx="1a01">
<!--TxPDO 2-->
<pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="BLANK"/>
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="statusword" halType="BLANK"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="position-actual-value" halType="BLANK"/>
<pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digital-inputs" halType="BLANK"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="modes-of-operation-display" halType="BLANK"/>
</pdo>
<pdo idx="1601">
<!--RxPDO 2-->
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="controlword" halType="BLANK"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="modes-of-operation" halType="BLANK"/>
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="target-position" halType="BLANK"/>
<pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="BLANK"/>
<pdoEntry idx="6099" subIdx="01" bitLen="32" halPin="search-switch" halType="BLANK"/>
<pdoEntry idx="6099" subIdx="02" bitLen="32" halPin="search-zero" halType="BLANK"/>
</pdo>
</syncManager>
<syncManager idx="1" dir="out"/>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="pin-6040-00" halType="BLANK"/>
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="pin-607a-00" halType="BLANK"/>
<pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="pin-60ff-00" halType="BLANK"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="pin-6060-00" halType="BLANK"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="pin-6041-00" halType="BLANK"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="pin-6064-00" halType="BLANK"/>
<pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="pin-606c-00" halType="BLANK"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="pin-6061-00" halType="BLANK"/>
</pdo>
</syncManager>
</slave>
</master>
</masters>
phil@SodickA:~/linuxcnc/configs/sim.axis$ ethercat pdos
=== Master 0, Slave 0 ===
SM0: PhysAddr 0x1000, DefaultSize 128, ControlRegister 0x26, Enable 1
RxPDO 0x1a01 "TxPDO 2"
PDO entry 0x603f:00, 16 bit, "ErrorCode"
PDO entry 0x6041:00, 16 bit, "StatusWord"
PDO entry 0x6064:00, 32 bit, "Position actual value"
PDO entry 0x60fd:00, 32 bit, "Digital inputs"
PDO entry 0x6061:00, 8 bit, "Modes of operation display"
RxPDO 0x1601 "RxPDO 2"
PDO entry 0x6040:00, 16 bit, "ControlWord"
PDO entry 0x6060:00, 8 bit, "Modes of operation"
PDO entry 0x607a:00, 32 bit, "Target position"
PDO entry 0x6081:00, 32 bit, "Profile velocity"
PDO entry 0x6099:01, 32 bit, "Search Switch"
PDO entry 0x6099:02, 32 bit, "Search Zero"
SM1: PhysAddr 0x1100, DefaultSize 128, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1200, DefaultSize 12, ControlRegister 0x64, Enable 1
RxPDO 0x1600 ""
PDO entry 0x6040:00, 16 bit, ""
PDO entry 0x607a:00, 32 bit, ""
PDO entry 0x60ff:00, 32 bit, ""
PDO entry 0x6060:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
SM3: PhysAddr 0x1300, DefaultSize 19, ControlRegister 0x20, Enable 1
TxPDO 0x1a00 ""
PDO entry 0x6041:00, 16 bit, ""
PDO entry 0x6064:00, 32 bit, ""
PDO entry 0x606c:00, 32 bit, ""
PDO entry 0x6061:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
=== Master 0, Slave 1 ===
SM0: PhysAddr 0x1000, DefaultSize 128, ControlRegister 0x26, Enable 1
RxPDO 0x1a01 "TxPDO 2"
PDO entry 0x603f:00, 16 bit, "ErrorCode"
PDO entry 0x6041:00, 16 bit, "StatusWord"
PDO entry 0x6064:00, 32 bit, "Position actual value"
PDO entry 0x60fd:00, 32 bit, "Digital inputs"
PDO entry 0x6061:00, 8 bit, "Modes of operation display"
RxPDO 0x1601 "RxPDO 2"
PDO entry 0x6040:00, 16 bit, "ControlWord"
PDO entry 0x6060:00, 8 bit, "Modes of operation"
PDO entry 0x607a:00, 32 bit, "Target position"
PDO entry 0x6081:00, 32 bit, "Profile velocity"
PDO entry 0x6099:01, 32 bit, "Search Switch"
PDO entry 0x6099:02, 32 bit, "Search Zero"
SM1: PhysAddr 0x1100, DefaultSize 128, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1200, DefaultSize 12, ControlRegister 0x64, Enable 1
RxPDO 0x1600 ""
PDO entry 0x6040:00, 16 bit, ""
PDO entry 0x607a:00, 32 bit, ""
PDO entry 0x60ff:00, 32 bit, ""
PDO entry 0x6060:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
SM3: PhysAddr 0x1300, DefaultSize 19, ControlRegister 0x20, Enable 1
TxPDO 0x1a00 ""
PDO entry 0x6041:00, 16 bit, ""
PDO entry 0x6064:00, 32 bit, ""
PDO entry 0x606c:00, 32 bit, ""
PDO entry 0x6061:00, 8 bit, ""
PDO entry 0x0000:00, 8 bit, "Gap"
phil@SodickA:~/linuxcnc/configs/sim.axis$ ethercat sdos
phil@SodickA:~/linuxcnc/configs/sim.axis$ ethercat -v slaves
=== Master 0, Slave 0 ===
Device: Main
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000a79
Product code: 0x00002000
Revision number: 0x00000001
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 0 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII up open yes - 1139426180 0 0
1 MII up open yes 1 1139427620 1440 720
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x0000/0, TX: 0x0000/0
Standard RX: 0x1000/128, TX: 0x1100/128
Supported protocols: CoE
General:
Group: EtherCAT Driver
Image name:
Order number:
Device name: OL3-E57H
CoE details:
Enable SDO: yes
Enable SDO Info: no
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: no
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 0 mA
=== Master 0, Slave 1 ===
Device: Main
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000a79
Product code: 0x00002000
Revision number: 0x00000001
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 720 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII down closed no 0 - - -
1 MII up open yes - 54668620 2396782160 0
2 N/A down closed no - - - -
3 N/A down closed no - - - -
Mailboxes:
Bootstrap RX: 0x0000/0, TX: 0x0000/0
Standard RX: 0x1000/128, TX: 0x1100/128
Supported protocols: CoE
General:
Group: EtherCAT Driver
Image name:
Order number:
Device name: OL3-E57H
CoE details:
Enable SDO: yes
Enable SDO Info: no
Enable PDO Assign: yes
Enable PDO Configuration: yes
Enable Upload at startup: no
Enable SDO complete access: no
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 0 mA
phil@SodickA:~/linuxcnc/configs/sim.axis$ lcec_configgen
<masters>
<master idx="0">
<slave idx="0" type="generic" vid="0x00000a79" pid="0x00002000" name="D1">
<!--OL3-E57H-->
<syncManager idx="0" dir="out">
<pdo idx="1a01">
<!--TxPDO 2-->
<pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="BLANK"/>
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="statusword" halType="BLANK"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="position-actual-value" halType="BLANK"/>
<pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digital-inputs" halType="BLANK"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="modes-of-operation-display" halType="BLANK"/>
</pdo>
<pdo idx="1601">
<!--RxPDO 2-->
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="controlword" halType="BLANK"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="modes-of-operation" halType="BLANK"/>
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="target-position" halType="BLANK"/>
<pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="BLANK"/>
<pdoEntry idx="6099" subIdx="01" bitLen="32" halPin="search-switch" halType="BLANK"/>
<pdoEntry idx="6099" subIdx="02" bitLen="32" halPin="search-zero" halType="BLANK"/>
</pdo>
</syncManager>
<syncManager idx="1" dir="out"/>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="pin-6040-00" halType="BLANK"/>
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="pin-607a-00" halType="BLANK"/>
<pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="pin-60ff-00" halType="BLANK"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="pin-6060-00" halType="BLANK"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="pin-6041-00" halType="BLANK"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="pin-6064-00" halType="BLANK"/>
<pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="pin-606c-00" halType="BLANK"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="pin-6061-00" halType="BLANK"/>
</pdo>
</syncManager>
</slave>
<slave idx="1" type="generic" vid="0x00000a79" pid="0x00002000" name="D2">
<!--OL3-E57H-->
<syncManager idx="0" dir="out">
<pdo idx="1a01">
<!--TxPDO 2-->
<pdoEntry idx="603f" subIdx="00" bitLen="16" halPin="errorcode" halType="BLANK"/>
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="statusword" halType="BLANK"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="position-actual-value" halType="BLANK"/>
<pdoEntry idx="60fd" subIdx="00" bitLen="32" halPin="digital-inputs" halType="BLANK"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="modes-of-operation-display" halType="BLANK"/>
</pdo>
<pdo idx="1601">
<!--RxPDO 2-->
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="controlword" halType="BLANK"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="modes-of-operation" halType="BLANK"/>
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="target-position" halType="BLANK"/>
<pdoEntry idx="6081" subIdx="00" bitLen="32" halPin="profile-velocity" halType="BLANK"/>
<pdoEntry idx="6099" subIdx="01" bitLen="32" halPin="search-switch" halType="BLANK"/>
<pdoEntry idx="6099" subIdx="02" bitLen="32" halPin="search-zero" halType="BLANK"/>
</pdo>
</syncManager>
<syncManager idx="1" dir="out"/>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="pin-6040-00" halType="BLANK"/>
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="pin-607a-00" halType="BLANK"/>
<pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="pin-60ff-00" halType="BLANK"/>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="pin-6060-00" halType="BLANK"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="pin-6041-00" halType="BLANK"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="pin-6064-00" halType="BLANK"/>
<pdoEntry idx="606c" subIdx="00" bitLen="32" halPin="pin-606c-00" halType="BLANK"/>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="pin-6061-00" halType="BLANK"/>
</pdo>
</syncManager>
</slave>
</master>
</masters>
Please Log in or Create an account to join the conversation.
- Tntmold
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
20 Mar 2025 15:10 - 20 Mar 2025 15:55 #324362
by Tntmold
Replied by Tntmold on topic General Questions about using ethercat
Thanks for your help, I used the output from lcec_configgen and replaced all the BLANK halType entries as S32 or U32, but now I get other errors, am I missing information in the xml file?:
phil@SodickA:~/linuxcnc/configs/sim.axis$ linuxcnc lathe.ini
LINUXCNC - 2.9.3
Machine configuration directory is '/home/phil/linuxcnc/configs/sim.axis'
Machine configuration file is 'lathe.ini'
Starting LinuxCNC...
libnml/buffer/shmem.cc 320: Shared memory buffers toolCmd and toolCmd may conflict. (key=1004(0x3EC))
libnml/buffer/shmem.cc 320: Shared memory buffers toolSts and toolSts may conflict. (key=1005(0x3ED))
libnml/buffer/shmem.cc 320: Shared memory buffers emcError and emcError may conflict. (key=1003(0x3EB))
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(LIB): /usr/share/linuxcnc/hallib/basic_sim.tcl
setup_kins: cmd=loadrt trivkins coordinates=xz
Found file(REL): ./ethercat.hal
LCEC: Invalid appTimePeriod of 0 for master 0 (should be 1000000).
LCEC: Invalid appTimePeriod of 0 for master 0 (should be 1000000).
link (updating variable file): No such file or directory
note: MAXV max: 3.333 units/sec 200.000 units/min
note: LJOG max: 3.333 units/sec 200.000 units/min
note: LJOG default: 1.000 units/sec 60.000 units/min
note: jog_order='ZX'
note: jog_invert={'X'}
task: main loop took 0.038776 seconds
task: main loop took 0.019003 seconds
Shutting down and cleaning up LinuxCNC...
task: 32479 cycles, min=0.000007, max=0.038776, avg=0.001059, 2 latency excursions (> 10x expected cycle time of 0.001000s)
Note: Using POSIX realtime
phil@SodickA:~/linuxcnc/configs/sim.axis$ linuxcnc lathe.ini
LINUXCNC - 2.9.3
Machine configuration directory is '/home/phil/linuxcnc/configs/sim.axis'
Machine configuration file is 'lathe.ini'
Starting LinuxCNC...
libnml/buffer/shmem.cc 320: Shared memory buffers toolCmd and toolCmd may conflict. (key=1004(0x3EC))
libnml/buffer/shmem.cc 320: Shared memory buffers toolSts and toolSts may conflict. (key=1005(0x3ED))
libnml/buffer/shmem.cc 320: Shared memory buffers emcError and emcError may conflict. (key=1003(0x3EB))
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(LIB): /usr/share/linuxcnc/hallib/basic_sim.tcl
setup_kins: cmd=loadrt trivkins coordinates=xz
Found file(REL): ./ethercat.hal
LCEC: Invalid appTimePeriod of 0 for master 0 (should be 1000000).
LCEC: Invalid appTimePeriod of 0 for master 0 (should be 1000000).
link (updating variable file): No such file or directory
note: MAXV max: 3.333 units/sec 200.000 units/min
note: LJOG max: 3.333 units/sec 200.000 units/min
note: LJOG default: 1.000 units/sec 60.000 units/min
note: jog_order='ZX'
note: jog_invert={'X'}
task: main loop took 0.038776 seconds
task: main loop took 0.019003 seconds
Shutting down and cleaning up LinuxCNC...
task: 32479 cycles, min=0.000007, max=0.038776, avg=0.001059, 2 latency excursions (> 10x expected cycle time of 0.001000s)
Note: Using POSIX realtime
Last edit: 20 Mar 2025 15:55 by Tntmold.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 595
- Thank you received: 188
20 Mar 2025 17:09 #324364
by Hakan
Replied by Hakan on topic General Questions about using ethercat
Much better.
In the second line, the "<master idx="0">" line
add so it becomes <master idx="0" appTimePeriod="1000000">
that 1000000 number must match your SERVO_PERIOD setting in the ini file. It is normally 1000000 (= 1 millisecond)
Let's see if that is enough or if you also need to specify distributed clock settings.
In the second line, the "<master idx="0">" line
add so it becomes <master idx="0" appTimePeriod="1000000">
that 1000000 number must match your SERVO_PERIOD setting in the ini file. It is normally 1000000 (= 1 millisecond)
Let's see if that is enough or if you also need to specify distributed clock settings.
Please Log in or Create an account to join the conversation.
- Tntmold
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
20 Mar 2025 18:52 #324371
by Tntmold
Replied by Tntmold on topic General Questions about using ethercat
I still get the shared memory buffers warnings (as before) but linuxcnc will start. The drives show to be in OP status and the linuxcnc shows the axis moving, but the steppers do not move
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 595
- Thank you received: 188
20 Mar 2025 19:25 #324372
by Hakan
Replied by Hakan on topic General Questions about using ethercat
I have had the shared memory warning too. I don't think that's related to ethercat, it is something else. I ignored the warning and well it didn't go away but I can't see it causing a problem.
So the drives are in OP, good.
But you use that minimal hal file, the four lines hal file you attached?
You now need to have a hal file describing the movements and limit switches and so on. From a real linuxcnc system.
I guess you have a lathe in mind.
Your drives are cia402 drives, one way is to start from the cia402 example, link here. github.com/dbraun1981/hal-cia402/tree/main/example
You can have a look in the example ethercat-conf.xml for inspiration, but use your own.
The hal file you can use. It's for one axis, you extend it to a Z axis.
So the drives are in OP, good.
But you use that minimal hal file, the four lines hal file you attached?
You now need to have a hal file describing the movements and limit switches and so on. From a real linuxcnc system.
I guess you have a lathe in mind.
Your drives are cia402 drives, one way is to start from the cia402 example, link here. github.com/dbraun1981/hal-cia402/tree/main/example
You can have a look in the example ethercat-conf.xml for inspiration, but use your own.
The hal file you can use. It's for one axis, you extend it to a Z axis.
Please Log in or Create an account to join the conversation.
- Tntmold
- Offline
- Junior Member
-
Less
More
- Posts: 24
- Thank you received: 1
20 Mar 2025 22:17 #324383
by Tntmold
Replied by Tntmold on topic General Questions about using ethercat
Thank you for helping, I used the dbraun1981 example hal file to modify mine, but I don't think I quite have it. The example seemed to have 3 axis for part of it and then only define x axis at the end, so I attempted to modify both areas, but I now get the following when I try to start linuxcnc:
phil@SodickA:~/linuxcnc/configs/sim.axis$ linuxcnc lathe.ini
LINUXCNC - 2.9.3
Machine configuration directory is '/home/phil/linuxcnc/configs/sim.axis'
Machine configuration file is 'lathe.ini'
Starting LinuxCNC...
libnml/buffer/shmem.cc 320: Shared memory buffers toolCmd and toolCmd may conflict. (key=1004(0x3EC))
libnml/buffer/shmem.cc 320: Shared memory buffers toolSts and toolSts may conflict. (key=1005(0x3ED))
libnml/buffer/shmem.cc 320: Shared memory buffers emcError and emcError may conflict. (key=1003(0x3EB))
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(LIB): /usr/share/linuxcnc/hallib/basic_sim.tcl
setup_kins: cmd=loadrt trivkins coordinates=xz
Found file(REL): ./ethercat.hal
trivkins: already exists
./ethercat.hal:11: waitpid failed /usr/bin/rtapi_app trivkins
./ethercat.hal:11: /usr/bin/rtapi_app exited without becoming ready
./ethercat.hal:11: insmod for trivkins failed, returned -1
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/phil/linuxcnc_debug.txt
and
/home/phil/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
Here is my HAL file:
###########################################################
#
# CIA 402 example snippet Hal
#
###########################################################
###########################################################
# Setup
###########################################################
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
loadrt cia402 count=2
loadrt pid names=x-pid,z-pid
###########################################################
# Functions servo-thread
###########################################################
addf lcec.read-all servo-thread
addf cia402.0.read-all servo-thread
addf cia402.1.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf x-pid.do-pid-calcs servo-thread
addf z-pid.do-pid-calcs servo-thread
addf cia402.0.write-all servo-thread
addf cia402.1.write-all servo-thread
addf lcec.write-all servo-thread
#########################################
#nets
#########################################
net emc-enable => iocontrol.0.emc-enable-in
sets emc-enable 1
#config
setp cia402.0.csp-mode 1
setp cia402.0.pos-scale 3600
setp cia402.1.csp-mode 1
setp cia402.1.pos-scale 3600
#from servo(ethercat) to cia402
net x-statusword lcec.0.0.cia-statusword => cia402.0.statusword
net x-opmode-display lcec.0.0.opmode-display => cia402.0.opmode-display
net x-drv-act-pos lcec.0.0.actual-position => cia402.0.drv-actual-position
net x-drv-act-velo lcec.0.0.actual-velocity => cia402.0.drv-actual-velocity
net z-statusword lcec.1.0.cia-statusword => cia402.1.statusword
net z-opmode-display lcec.1.0.opmode-display => cia402.1.opmode-display
net z-drv-act-pos lcec.1.0.actual-position => cia402.1.drv-actual-position
net z-drv-act-velo lcec.1.0.actual-velocity => cia402.1.drv-actual-velocity
#from cia402 to servo(ethercat)
net x-controlword cia402.0.controlword => lcec.0.0.cia-controlword
net x-modes-of-operation cia402.0.opmode => lcec.0.0.opmode
net x-drv-target-pos cia402.0.drv-target-position => lcec.0.0.target-position
net x-drv-target-velo cia402.0.drv-target-velocity => lcec.0.0.target-velocity
net z-controlword cia402.1.controlword => lcec.1.0.cia-controlword
net z-modes-of-operation cia402.1.opmode => lcec.1.0.opmode
net z-drv-target-pos cia402.1.drv-target-position => lcec.1.0.target-position
net z-drv-target-velo cia402.1.drv-target-velocity => lcec.1.0.target-velocity
#from motion to cia
net x-enable <= joint.0.amp-enable-out => cia402.0.enable
net x-amp-fault => joint.0.amp-fault-in <= cia402.0.drv-fault
net x-pos-cmd <= joint.0.motor-pos-cmd => cia402.0.pos-cmd
net x-pos-fb => joint.0.motor-pos-fb <= cia402.0.pos-fb
net z-enable <= joint.1.amp-enable-out => cia402.1.enable
net z-amp-fault => joint.1.amp-fault-in <= cia402.1.drv-fault
net z-pos-cmd <= joint.1.motor-pos-cmd => cia402.1.pos-cmd
net z-pos-fb => joint.1.motor-pos-fb <= cia402.1.pos-fb
#homing
net x-home-index <= joint.0.index-enable => cia402.0.home
net z-home-index <= joint.1.index-enable => cia402.1.home
phil@SodickA:~/linuxcnc/configs/sim.axis$ linuxcnc lathe.ini
LINUXCNC - 2.9.3
Machine configuration directory is '/home/phil/linuxcnc/configs/sim.axis'
Machine configuration file is 'lathe.ini'
Starting LinuxCNC...
libnml/buffer/shmem.cc 320: Shared memory buffers toolCmd and toolCmd may conflict. (key=1004(0x3EC))
libnml/buffer/shmem.cc 320: Shared memory buffers toolSts and toolSts may conflict. (key=1005(0x3ED))
libnml/buffer/shmem.cc 320: Shared memory buffers emcError and emcError may conflict. (key=1003(0x3EB))
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(LIB): /usr/share/linuxcnc/hallib/basic_sim.tcl
setup_kins: cmd=loadrt trivkins coordinates=xz
Found file(REL): ./ethercat.hal
trivkins: already exists
./ethercat.hal:11: waitpid failed /usr/bin/rtapi_app trivkins
./ethercat.hal:11: /usr/bin/rtapi_app exited without becoming ready
./ethercat.hal:11: insmod for trivkins failed, returned -1
Shutting down and cleaning up LinuxCNC...
Note: Using POSIX realtime
LinuxCNC terminated with an error. You can find more information in the log:
/home/phil/linuxcnc_debug.txt
and
/home/phil/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
Here is my HAL file:
###########################################################
#
# CIA 402 example snippet Hal
#
###########################################################
###########################################################
# Setup
###########################################################
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
loadrt cia402 count=2
loadrt pid names=x-pid,z-pid
###########################################################
# Functions servo-thread
###########################################################
addf lcec.read-all servo-thread
addf cia402.0.read-all servo-thread
addf cia402.1.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf x-pid.do-pid-calcs servo-thread
addf z-pid.do-pid-calcs servo-thread
addf cia402.0.write-all servo-thread
addf cia402.1.write-all servo-thread
addf lcec.write-all servo-thread
#########################################
#nets
#########################################
net emc-enable => iocontrol.0.emc-enable-in
sets emc-enable 1
#config
setp cia402.0.csp-mode 1
setp cia402.0.pos-scale 3600
setp cia402.1.csp-mode 1
setp cia402.1.pos-scale 3600
#from servo(ethercat) to cia402
net x-statusword lcec.0.0.cia-statusword => cia402.0.statusword
net x-opmode-display lcec.0.0.opmode-display => cia402.0.opmode-display
net x-drv-act-pos lcec.0.0.actual-position => cia402.0.drv-actual-position
net x-drv-act-velo lcec.0.0.actual-velocity => cia402.0.drv-actual-velocity
net z-statusword lcec.1.0.cia-statusword => cia402.1.statusword
net z-opmode-display lcec.1.0.opmode-display => cia402.1.opmode-display
net z-drv-act-pos lcec.1.0.actual-position => cia402.1.drv-actual-position
net z-drv-act-velo lcec.1.0.actual-velocity => cia402.1.drv-actual-velocity
#from cia402 to servo(ethercat)
net x-controlword cia402.0.controlword => lcec.0.0.cia-controlword
net x-modes-of-operation cia402.0.opmode => lcec.0.0.opmode
net x-drv-target-pos cia402.0.drv-target-position => lcec.0.0.target-position
net x-drv-target-velo cia402.0.drv-target-velocity => lcec.0.0.target-velocity
net z-controlword cia402.1.controlword => lcec.1.0.cia-controlword
net z-modes-of-operation cia402.1.opmode => lcec.1.0.opmode
net z-drv-target-pos cia402.1.drv-target-position => lcec.1.0.target-position
net z-drv-target-velo cia402.1.drv-target-velocity => lcec.1.0.target-velocity
#from motion to cia
net x-enable <= joint.0.amp-enable-out => cia402.0.enable
net x-amp-fault => joint.0.amp-fault-in <= cia402.0.drv-fault
net x-pos-cmd <= joint.0.motor-pos-cmd => cia402.0.pos-cmd
net x-pos-fb => joint.0.motor-pos-fb <= cia402.0.pos-fb
net z-enable <= joint.1.amp-enable-out => cia402.1.enable
net z-amp-fault => joint.1.amp-fault-in <= cia402.1.drv-fault
net z-pos-cmd <= joint.1.motor-pos-cmd => cia402.1.pos-cmd
net z-pos-fb => joint.1.motor-pos-fb <= cia402.1.pos-fb
#homing
net x-home-index <= joint.0.index-enable => cia402.0.home
net z-home-index <= joint.1.index-enable => cia402.1.home
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 595
- Thank you received: 188
21 Mar 2025 07:08 #324399
by Hakan
Replied by Hakan on topic General Questions about using ethercat
From this hereIt looks like you are including basic_sim.tcl. You got to remove that inclusion.
It's in the .ini file, comment out that line, the line looks something like HALFILE=LIB:basic_sim.tcl
Note: Using POSIX realtime
Found file(LIB): /usr/share/linuxcnc/hallib/basic_sim.tcl
setup_kins: cmd=loadrt trivkins coordinates=xz
Found file(REL): ./ethercat.hal
trivkins: already exists
./ethercat.hal:11: waitpid failed
It's in the .ini file, comment out that line, the line looks something like HALFILE=LIB:basic_sim.tcl
Please Log in or Create an account to join the conversation.
Time to create page: 0.184 seconds