필터 지우기
필터 지우기

How to use compiled mexw64 functions in User defined Simulink blocks

조회 수: 10 (최근 30일)
Lukas Abelt
Lukas Abelt 2017년 6월 2일
답변: Don Zheng 2017년 6월 8일
Hello everyone,
For my current project I am working on I need to transfer data between multiple Simulink instances running on individual PC's. The connection will be established using a TCP Connection. As the existing Receive/Transmit blocks only act as clients I need to implement Server functionality. Simulink itself (sadly) does not offer this capability. I am now trying to use this toolbox that (with some tweaks to make it compatible) seems to work fine for matlab. When I use it in the matlab command window it works just fine. Now I wanted to implement this into my Simulink model. I tried to call the pnet methods (for example
socket=pnet('tcpsocket',25000)
)the toolbox provides within a System Object but as the toolbox compiles to a mexw64 file I couldn't get it to work.
Now I wanted to ask if there would be any way to use this Toolbox in a system object or if I Need to use another approach (Matlab S-function?). Or, even better, if someone had a reliable, working, solution for TCP Server functionality in Simulink (I know about the workaround using echotcpip but I cannot use it for this case) Thanks in advance
Lukas

답변 (1개)

Don Zheng
Don Zheng 2017년 6월 8일
coder.extrinsic should work for simulation and also remember to initialize some outputs from the MEX function.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by