Hi,
The ethercat auto configurator works finally !!
When program starts, it initializes the ethercat devices by retrieving a digital xml configuration.
For this i poked around in the etherlab source code, and added some function's to retrieve this digital xml information.
From the given digital xml information, it then does some logic and it create's hal pins automaticly.
This is ideal for lazy system integrators. image missing /media/kunena/emoticons/smile.png
For this to use you don't need a .xml config file like in linuxcnc-ethercat.
I also solved a etherlab_master software
bug
related to slave alias numbers, wich where not consistent and
resulted in head scratching for some time as the aliases are not printed by : "$ ethercat xml"
The terminal output when starting the program :
Code:
Starting EtherCAT master 1.5.2 done
init example 0.
init ethercat start.
Print ethercat devices and retrieve device data vector.
No alias given, alias -
pdo entry registration:
Name:EL2124 4K. Dig. Ausgang 5V, 20mA
Slave Alias: 0
Position: 1
Vendor ID: 2
Product Code: #x084c3052
PDO Entry Index: #x7000
PDO Entry Subindex: 1
Name:EL2124 4K. Dig. Ausgang 5V, 20mA
Slave Alias: 0
Position: 2
Vendor ID: 2
Product Code: #x084c3052
PDO Entry Index: #x7000
PDO Entry Subindex: 1
Name:EL2124 4K. Dig. Ausgang 5V, 20mA
Slave Alias: 0
Position: 3
Vendor ID: 2
Product Code: #x084c3052
PDO Entry Index: #x7000
PDO Entry Subindex: 1
Name:EL1004 4K. Dig. Eingang 24V, 3ms
Slave Alias: 0
Position: 4
Vendor ID: 2
Product Code: #x03ec3052
PDO Entry Index: #x6000
PDO Entry Subindex: 1
Name:EL2794 4K. Dig. Ausgang 24V AC/DC, 2A, kurzschlussfest
Slave Alias: 0
Position: 5
Vendor ID: 2
Product Code: #x0aea3052
PDO Entry Index: #x7000
PDO Entry Subindex: 1
Name:EL2808 8K. Dig. Ausgang 24V, 0.5A
Slave Alias: 0
Position: 6
Vendor ID: 2
Product Code: #x0af83052
PDO Entry Index: #x7000
PDO Entry Subindex: 1
Name:EL3162 2K. Ana. Eingang 0-10V
Slave Alias: 0
Position: 7
Vendor ID: 2
Product Code: #x0c5a3052
PDO Entry Index: #x3101
PDO Entry Subindex: 1
Name:EL3162 2K. Ana. Eingang 0-10V
Slave Alias: 0
Position: 7
Vendor ID: 2
Product Code: #x0c5a3052
PDO Entry Index: #x3101
PDO Entry Subindex: 2
Name:EL3162 2K. Ana. Eingang 0-10V
Slave Alias: 0
Position: 7
Vendor ID: 2
Product Code: #x0c5a3052
PDO Entry Index: #x3102
PDO Entry Subindex: 1
Name:EL3162 2K. Ana. Eingang 0-10V
Slave Alias: 0
Position: 7
Vendor ID: 2
Product Code: #x0c5a3052
PDO Entry Index: #x3102
PDO Entry Subindex: 2
Name: empty
Slave Alias: 0
Position: 0
Vendor ID: 0
Product Code: #x00000000
PDO Entry Index: #x0000
PDO Entry Subindex: 0
halpin names:
EL2124_1_0_0_IN_BOOL
EL2124_1_1_0_IN_BOOL
EL2124_1_2_0_IN_BOOL
EL2124_1_3_0_IN_BOOL
EL2124_2_0_0_IN_BOOL
EL2124_2_1_0_IN_BOOL
EL2124_2_2_0_IN_BOOL
EL2124_2_3_0_IN_BOOL
EL2124_3_0_0_IN_BOOL
EL2124_3_1_0_IN_BOOL
EL2124_3_2_0_IN_BOOL
EL2124_3_3_0_IN_BOOL
EL1004_4_0_0_OUT_BOOL
EL1004_4_1_0_OUT_BOOL
EL1004_4_2_0_OUT_BOOL
EL1004_4_3_0_OUT_BOOL
EL2794_5_0_0_IN_BOOL
EL2794_5_1_0_IN_BOOL
EL2794_5_2_0_IN_BOOL
EL2794_5_3_0_IN_BOOL
EL2808_6_0_0_IN_BOOL
EL2808_6_1_0_IN_BOOL
EL2808_6_2_0_IN_BOOL
EL2808_6_3_0_IN_BOOL
EL2808_6_4_0_IN_BOOL
EL2808_6_5_0_IN_BOOL
EL2808_6_6_0_IN_BOOL
EL2808_6_7_0_IN_BOOL
EL3162_7_0_0_OUT_UINT
EL3162_7_0_1_OUT_UINT
EL3162_7_1_0_OUT_UINT
EL3162_7_1_1_OUT_UINT
PDO entry registration ok.
Master ok.
domain1_pd ok.
init ethercat succes.
So far 4 data types are integrated : bool, uint, string, bit.
It currently looks at one master. But code may look at more masters in the future.
So far so good !
Integration in linuxcnc is not that difficult, as you can add this code into a component, using a function like
rtapi_app_main(); will then run the code, will also create hal pin's etc. with some slightly modifications.