Exotic data types in .xml config

More
29 Jul 2024 18:56 #306354 by endian
Hello,

have anybody idea how to define data type array of bytes in the ethercat-conf.xml file which is loaded during startup of lcec?

I am working currently on some configuration file and in the twincat 3 enviroment is slave described PDOs as array[0...7] of bytes ...

I think if there will be definition over "complex" data type and inside will be byte to byte definition of each variable ...have anybody experiences with something like I desribed higher please?

thanks

regards

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

More
29 Jul 2024 19:44 #306357 by scottlaird
Do you have a more concrete example? I'm trying to think of how that's different from either an UINT64 or 8 UINT8s, depending on use.

Which device?

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

More
31 Jul 2024 18:35 - 01 Aug 2024 09:33 #306553 by endian
It is EL6751 CANopen master from beckhoff with some sew lte-b+ vfd wchich is build in them directly. When I working on it via the TwinCAT3 enviroment, there are TX RX PDOs formated in the shape which I last described.. array[0...7] of bytes

I think there should be possibility to write them as complex with 64bit size and then slice it inside to correct s32 or u32s for the hal...

regards
Last edit: 01 Aug 2024 09:33 by endian.

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

More
31 Jul 2024 19:42 #306559 by endian
this is status without SDO mapping done
user@user:~/ethercat-master$ ethercat slaves
0  0:0  PREOP  +  EK1100 EtherCAT Coupler (2A E-Bus)
1  0:1  PREOP  +  EL1008 8Ch. Dig. Input 24V, 3ms
2  0:2  PREOP  +  EL1018 8Ch. Dig. Input 24V, 10�s
3  0:3  PREOP  +  EL1018 8K. Dig. Eingang 24V, 10�s
4  0:4  PREOP  +  EL1018 8K. Dig. Eingang 24V, 10�s
5  0:5  PREOP  +  EL1018 8K. Dig. Eingang 24V, 10�s
6  0:6  PREOP  +  EL2008 8K. Dig. Ausgang 24V, 0.5A
7  0:7  PREOP  +  EL2124 4K. Dig. Ausgang 5V, 20mA
8  0:8  PREOP  +  EL6751 CANopen Master
user@user:~/ethercat-master$ ethercat pdos
=== Master 0, Slave 1 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 2 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 3 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 4 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 5 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 6 ===
SM0: PhysAddr 0x0f00, DefaultSize    0, ControlRegister 0x44, Enable 9
  RxPDO 0x1600 "Channel 1"
    PDO entry 0x7000:01,  1 bit, "Output"
  RxPDO 0x1601 "Channel 2"
    PDO entry 0x7010:01,  1 bit, "Output"
  RxPDO 0x1602 "Channel 3"
    PDO entry 0x7020:01,  1 bit, "Output"
  RxPDO 0x1603 "Channel 4"
    PDO entry 0x7030:01,  1 bit, "Output"
  RxPDO 0x1604 "Channel 5"
    PDO entry 0x7040:01,  1 bit, "Output"
  RxPDO 0x1605 "Channel 6"
    PDO entry 0x7050:01,  1 bit, "Output"
  RxPDO 0x1606 "Channel 7"
    PDO entry 0x7060:01,  1 bit, "Output"
  RxPDO 0x1607 "Channel 8"
    PDO entry 0x7070:01,  1 bit, "Output"
=== Master 0, Slave 7 ===
SM0: PhysAddr 0x0f00, DefaultSize    0, ControlRegister 0x44, Enable 9
  RxPDO 0x1600 "Channel 1"
    PDO entry 0x7000:01,  1 bit, "Output"
  RxPDO 0x1601 "Channel 2"
    PDO entry 0x7010:01,  1 bit, "Output"
  RxPDO 0x1602 "Channel 3"
    PDO entry 0x7020:01,  1 bit, "Output"
  RxPDO 0x1603 "Channel 4"
    PDO entry 0x7030:01,  1 bit, "Output"
=== Master 0, Slave 8 ===
SM0: PhysAddr 0x1000, DefaultSize 1024, ControlRegister 0x26, Enable 1
SM1: PhysAddr 0x1400, DefaultSize 1024, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1800, DefaultSize    0, ControlRegister 0x26, Enable 1
SM3: PhysAddr 0x2400, DefaultSize    0, ControlRegister 0x22, Enable 1
 

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

More
01 Aug 2024 09:13 - 01 Aug 2024 09:32 #306594 by endian

this is status without SDO mapping done
user@user:~/ethercat-master$ ethercat slaves
0  0:0  PREOP  +  EK1100 EtherCAT Coupler (2A E-Bus)
1  0:1  PREOP  +  EL1008 8Ch. Dig. Input 24V, 3ms
2  0:2  PREOP  +  EL1018 8Ch. Dig. Input 24V, 10�s
3  0:3  PREOP  +  EL1018 8K. Dig. Eingang 24V, 10�s
4  0:4  PREOP  +  EL1018 8K. Dig. Eingang 24V, 10�s
5  0:5  PREOP  +  EL1018 8K. Dig. Eingang 24V, 10�s
6  0:6  PREOP  +  EL2008 8K. Dig. Ausgang 24V, 0.5A
7  0:7  PREOP  +  EL2124 4K. Dig. Ausgang 5V, 20mA
8  0:8  PREOP  +  EL6751 CANopen Master



[code]user@user:~/ethercat-master$ ethercat pdos
=== Master 0, Slave 1 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 2 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 3 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 4 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 5 ===
SM0: PhysAddr 0x1000, DefaultSize    1, ControlRegister 0x00, Enable 1
  TxPDO 0x1a00 "Channel 1"
    PDO entry 0x6000:01,  1 bit, "Input"
  TxPDO 0x1a01 "Channel 2"
    PDO entry 0x6010:01,  1 bit, "Input"
  TxPDO 0x1a02 "Channel 3"
    PDO entry 0x6020:01,  1 bit, "Input"
  TxPDO 0x1a03 "Channel 4"
    PDO entry 0x6030:01,  1 bit, "Input"
  TxPDO 0x1a04 "Channel 5"
    PDO entry 0x6040:01,  1 bit, "Input"
  TxPDO 0x1a05 "Channel 6"
    PDO entry 0x6050:01,  1 bit, "Input"
  TxPDO 0x1a06 "Channel 7"
    PDO entry 0x6060:01,  1 bit, "Input"
  TxPDO 0x1a07 "Channel 8"
    PDO entry 0x6070:01,  1 bit, "Input"
=== Master 0, Slave 6 ===
SM0: PhysAddr 0x0f00, DefaultSize    0, ControlRegister 0x44, Enable 9
  RxPDO 0x1600 "Channel 1"
    PDO entry 0x7000:01,  1 bit, "Output"
  RxPDO 0x1601 "Channel 2"
    PDO entry 0x7010:01,  1 bit, "Output"
  RxPDO 0x1602 "Channel 3"
    PDO entry 0x7020:01,  1 bit, "Output"
  RxPDO 0x1603 "Channel 4"
    PDO entry 0x7030:01,  1 bit, "Output"
  RxPDO 0x1604 "Channel 5"
    PDO entry 0x7040:01,  1 bit, "Output"
  RxPDO 0x1605 "Channel 6"
    PDO entry 0x7050:01,  1 bit, "Output"
  RxPDO 0x1606 "Channel 7"
    PDO entry 0x7060:01,  1 bit, "Output"
  RxPDO 0x1607 "Channel 8"
    PDO entry 0x7070:01,  1 bit, "Output"
=== Master 0, Slave 7 ===
SM0: PhysAddr 0x0f00, DefaultSize    0, ControlRegister 0x44, Enable 9
  RxPDO 0x1600 "Channel 1"
    PDO entry 0x7000:01,  1 bit, "Output"
  RxPDO 0x1601 "Channel 2"
    PDO entry 0x7010:01,  1 bit, "Output"
  RxPDO 0x1602 "Channel 3"
    PDO entry 0x7020:01,  1 bit, "Output"
  RxPDO 0x1603 "Channel 4"
    PDO entry 0x7030:01,  1 bit, "Output"
=== Master 0, Slave 8 ===
SM0: PhysAddr 0x1000, DefaultSize 1024, ControlRegister 0x26, Enable 1
SM1: PhysAddr 0x1400, DefaultSize 1024, ControlRegister 0x22, Enable 1
SM2: PhysAddr 0x1800, DefaultSize    0, ControlRegister 0x26, Enable 1
SM3: PhysAddr 0x2400, DefaultSize    0, ControlRegister 0x22, Enable 1

 
 
[/code]
 

 
I did some paint science ... 

there are in the 2 and 3 SM are data objects 1A00 and 1600 which are filled from array of bytes...

next

there is a 1A80 data type which are describtion EL6751 itselt... 

have a look
Attachments:
Last edit: 01 Aug 2024 09:32 by endian.

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

More
02 Aug 2024 14:18 #306741 by scottlaird
Ah, yeah, the EL6751. I keep meaning to get around to trying to use mine for something, but it looks like more work than I really want right now :-).

The problem with mapping anything more complex than ints or floats is that LinuxCNC doesn't really have a good type to hold them, so there's no good way to create a pin for them. Even if we had an array of ints, there's no array type in LinuxCNC. OTOH, a fixed-size array is pretty trivial to map to 8 individual ints.

I'd love to see a working EL6751 config for *anything*; IIRC people have claimed that they've got it working once or twice, but I don't think we do a very good job at it.

If we *really* wanted to do a good job with the EL6751, we'd probably want to refactor LCEC to create a generic CANopen layer (PDOs, SDOs, etc), and then tie that to a lower-level EtherCAT layer plus a lower-level CANopen layer. Then the EL6751 could be a CoE EtherCAT device that exports a CANopen interface that we could run CANopen devices on top of.

That'd let us use generic CAN devices, and maybe even some RS485 devices, in addition to the EL6751 for talking to CANopen CiA 402 devices and so forth.

Except we don't actually *want* to use most CAN CiA 402 devices, because they don't support CSP/CSV modes, because CAN isn't fast enough. Mostly.

Anyway, it'd be a lot of work, and I'm not sure that there's a real payoff.
The following user(s) said Thank You: endian

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

More
02 Aug 2024 19:24 #306784 by endian

Ah, yeah, the EL6751. I keep meaning to get around to trying to use mine for something, but it looks like more work than I really want right now :-).

The problem with mapping anything more complex than ints or floats is that LinuxCNC doesn't really have a good type to hold them, so there's no good way to create a pin for them. Even if we had an array of ints, there's no array type in LinuxCNC. OTOH, a fixed-size array is pretty trivial to map to 8 individual ints.

I'd love to see a working EL6751 config for *anything*; IIRC people have claimed that they've got it working once or twice, but I don't think we do a very good job at it.

If we *really* wanted to do a good job with the EL6751, we'd probably want to refactor LCEC to create a generic CANopen layer (PDOs, SDOs, etc), and then tie that to a lower-level EtherCAT layer plus a lower-level CANopen layer. Then the EL6751 could be a CoE EtherCAT device that exports a CANopen interface that we could run CANopen devices on top of.

That'd let us use generic CAN devices, and maybe even some RS485 devices, in addition to the EL6751 for talking to CANopen CiA 402 devices and so forth.

Except we don't actually *want* to use most CAN CiA 402 devices, because they don't support CSP/CSV modes, because CAN isn't fast enough. Mostly.

Anyway, it'd be a lot of work, and I'm not sure that there's a real payoff.

yes for sure, CANopen is not a RT bus.. it is light weight and most cost effective pocket swiss knife ... I think when you will not use a CSS and rigid tapping a CANopen vfds should be usable as really budget cost solution... 

I will manage it and let you know how it should be... but I think it will be pain to do it...

Can you tell me how difficult is to create device.c and .k to define device via non generic definition please?

exactly I thinking about it the same... new layer for canopen slaves and add them to ethercat xml as generic... I will try to map them as complex a split them out via bits to something what lcnc will understand... RS485 is great but Profibus interface should be greater for us... there is whole galaxy of non supported devices as vfds and pneumatic terminal which should be usable ...I saw some project on this forum with profibus but it was in the python .. 

regards

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

More
02 Aug 2024 19:32 #306788 by endian
what is really not clear to mo how exactly type definition of these ending stuff ... I think it should be like this or ?
<syncManager idx="3" dir="in">
                    <pdo idx="1A00">
                        <pdoEntry idx="6000" subIdx="01" bitLen="64" halType="complex" />
                            <complexEntry bitLen="16" halPin="statusWord" halType="u32"/>
                            <complexEntry bitLen="16" halPin="actualSpeed" halType="s32"/>
                            <complexEntry bitLen="16" halPin="actualCurrent" halType="u32"/>
                            <complexEntry bitLen="16" halPin="motorTourqe" halType="s32"/>
                        </pdoEntry>
                        <pdoEntry idx="6000" subIdx="02" bitLen="64" halType="complex"/>
                            <complexEntry bitLen="16" halPin="analogIn1" halType="u32"/>
                            <complexEntry bitLen="16" halPin="analogIn2" halType="s32"/>
                            <complexEntry bitLen="16" halPin="DIOstatus" halType="u32"/>
                            <complexEntry bitLen="16" halPin="actualTemp" halType="u32"/>
                        </pdoEntry>
                    </pdo>
                    <pdo idx="1A80">
                        <pdoEntry idx="A000" subIdx="01" bitLen="08" halPin="slaveNodeState" halType="u32"/>
                        <pdoEntry idx="F100" subIdx="01" bitLen="08" halPin="canMasterError" halType="u32"/>
                        <pdoEntry idx="F100" subIdx="03" bitLen="16" halPin="canMasterState" halType="u32"/>
                        <pdoEntry idx="F100" subIdx="05" bitLen="08" halPin="canMasterRxErrorCounter" halType="u32"/>
                        <pdoEntry idx="F100" subIdx="04" bitLen="08" halPin="canMasterTxErrorCounter" halType="u32"/>
                        <pdoEntry idx="F100" subIdx="02" bitLen="01" halPin="canMasterDiagFlag" halType="bit"/>
                        <pdoEntry idx="A000" subIdx="02" bitLen="07" halType="complex" />
                            <complexEntry bitLen="01" halPin="slaveDiagFlag" halType="bit"/>
                            <complexEntry bitLen="06"/>
                        </pdoEntry>
                    </pdo>                    
Attachments:

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

More
04 Aug 2024 21:24 #306946 by endian
working twincat3 project with EL6751 and one slave... I am creating the .xml config and I will try them with etherlab master...

regards
Attachments:

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

Time to create page: 0.085 seconds
Powered by Kunena Forum