how to use tcpclient in simulink matlab function block
Show older comments
Hi
Trying to use tcpclient in simulink's matlab function block(function is attached). But I get stuck with following error.
I am aware that it is somehow linked to tcpclient function.
I am looking for alternative solution for this. Please suggest ideal solution for this.
The same code work when I use it as matlab script.
========================
Function writeline is not supported for code generation. Function 'CS9 Action Communication' (#24.196.237), line 8, column 1: "writeline(tcpClient,sprintf("%f",action))" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Function readline is not supported for code generation. Function 'CS9 Action Communication' (#24.291.310), line 11, column 13: "readline(tcpClient)" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Code generation does not support explicit calls to the 'delete' method. Function 'CS9 Action Communication' (#24.343.360), line 13, column 1: "delete(tcpClient)" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Undefined function or variable 'dReceived'. The first assignment to a local variable determines its class. Function 'CS9 Action Communication' (#24.387.396), line 15, column 25: "dReceived" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Undefined function or variable 'dataReceived'. The first assignment to a local variable determines its class. Function 'CS9 Action Communication' (#24.556.568), line 21, column 9: "dataReceived" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Undefined function or variable 'dataReceived'. The first assignment to a local variable determines its class. Function 'CS9 Action Communication' (#24.586.598), line 22, column 12: "dataReceived" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Undefined function or variable 'dataReceived'. The first assignment to a local variable determines its class. Function 'CS9 Action Communication' (#24.611.623), line 23, column 7: "dataReceived" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of MATLAB function 'HIL_rlwork_v3/CS9 Action Communication'
Component:MATLAB Function | Category:Coder error
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!