How to send a raw ethernet frame (for Ethercat Communication) in Simulink Realtime?

조회 수: 4 (최근 30일)
Hello, I am trying to power ON my motors that I can communicate with, via Ethercat through Simulink Realtime by transmitting a raw ethernet frame. I use the Ethernet init (realtime Ethernet Configuration) block to initialize the Ethernet communication (I am very sure of the addressing, PCI bus, slot etc.) and the create Ethernet packet block (The Ethertype is set to Ethercat: hex2dec('88A4')) and broadcast MAC: macaddr('FF:FF:FF:FF:FF:FF')). I also set the length of the byte string to 16 which I know is right. I also use EtherCAT init block in my model with the right xml file. Now when I send the byte sequence (ecat header + ecat datagram) in the data packet after byte unpacking, I get this error "Malformed message". The packet is in the format as [hex2dec('0300') hex2dec('0100') ...] and so on. I also know that the data I send to power on the motors is right because the same byte sequence when sent via a python script does the job. So can some one suggest where I might be wrong or show me an example of a raw ethernet frame byte sequence? Thanks in advance!

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by