Socket Programming with C-Mex
显示 更早的评论
Hello,
I'm in need of setting up a TCP/IP connection to a Simulink simulation (which will employ a demodulator). I am using RTW (Simulink Coder) to output C Code and an exe for the demod.
I need to send the data to the generated executable via TCP/IP. I'm currently looking to accomplish this via sockets through a C-Mex implementation with an S-function block.
I have C++ server and client code that compiles (and runs via cmd line - Windows XP 32 bit) but crashes MATLAB upon execution.
Any thoughts as to what may be causing the crashing or better ways to implement this architecture would be greatly appreciated.
Thanks,
Jason
回答(2 个)
Ed Laurence
2011-11-5
0 个投票
Hi Jason,
Did you get anywhere with this problem? I've been trying to get something similar working where I've embedded C code for a WinSock client in a level 2 S-function but as soon as I run the simulation Simulink hangs. I've tried debugging by attaching the MEX file to VS 2008 and have found some errors relating to invalid parameters passed to the C function but haven't managed to solve it yet.
Cheers,
Ed
Silmara da Silva Palmieri
2019-3-25
0 个投票
Hi Ed,
Did you get any answer regarding this problem? I am facing the same issue and have no clue how to check where is my problem.
Thank you!
Regards,
Silmara
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!