Simulink - TCP/IP Send / Receive Variable Size
조회 수: 4 (최근 30일)
이전 댓글 표시
Dear all,
I want to implement a Modbus TCP communication between MATLAB Simulink and a measurement device by using the Instrument Control Toolbox. For the Modbus protocol different function codes are defined, e.g. 0x04 for reading registers and 0x16 for writing registers. Depending on the function code the message to send/receive by the TCP/IP block differs in size. For both blocks (TCP/IP Send and Receive) you need to predefine how many bytes the message will be. You are also restricted to only use one block for the same target (IP/Port) in one model. Therefore it is impossible to do Modbus TCP/IP read and writing operations within the same model. I think this is quite a big limitation. Anybody has an idea how to overcome this challenge?
Regards
Jonathan
댓글 수: 0
채택된 답변
Govind KP
2020년 7월 14일
Hi Jonathan,
One possible way I can see is to create and use an m-func block in Simulink to call the modbus function.
You can find more details at this link
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Development Computer Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!