Why do I receive TCP/IP communication errors when I try to operate my Simulink Real-Time target computer as EtherCAT Master?

128 views (last 30 days)
I am using a Simulink Real-Time (SLRT) target computer that communicates with multiple slaves via EtherCAT. I am able to successfully build the model and load it onto the target. However, when I start the real-time simulation, I receive errors in MATLAB such as:
Error 1:
ERROR: External Mode Open Protocol Start command failed
Error 2:
ERROR: Executing the 'Start' command produced the following error:
TargetPC1: TCP/IP timeout while receiving data
Error 3:
ERROR: Executing the 'FinalUpload' command produced the following error:
TargetPC1: TCP/IP Read Error
At the same time, the target screen displays the following output:
System: initializing application finished
System: model thread stack is 64K bytes
EtherCAT Update rate 0.00025 sec
Could not set master state to PREOP
ERROR: EtherCAT error: No Error
System: execution cannot be started
System: execution stopped at 0.000000
Rx time is 0.000001
Cycl time is 0.000000
McSt time is 0.000003
MasterTimer is 0.000004
AsynctTime is 0.00000
xpcEtherCATstop called
EtherCAT Update rate 0.00025 sec

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 Oct 2021
Edited: MathWorks Support Team on 12 Oct 2021
The above error messages may indicate that there is a conflict between the Ethernet ports used for the host-target connection, and the one used to connect to the EtherCAT network. This may be due to incorrect settings in the EtherCAT Init block.
R2020a and earlier:
Ensure that all fields (such as "PCI Bus" and "PCI Slot") within the EtherCAT Init block are specified correctly, i.e., they match with the actual hardware setup.
R2020b and later:
Use the Ethernet Configuration utility (speedgoat.configureEthernet) which is part of Speedgoat I/O Blockset to reserve the correct Ethernet port for the EtherCAT Master:
If everything is specified correctly and the issue persists, please check that the network card(s) work.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by