TCP-IP Compiling Problems

2 views (last 30 days)
Eduardo Díaz Díaz
Eduardo Díaz Díaz on 1 Feb 2021
Hi everyone,
I am facing a problem that I don't even know if it is fixable.
I have created a function to communicate with a PLC and I am using tcp commands, such as this one:
t=tcpip(IP_str, Port_number, 'NetworkRole','server');,
where IP_str and Port_number are variables that define the IP and the port number of the PLC.
The problem comes up when I try to compile this function, becase the MATLAB Coder does not recognize tcp ip.
Do you know if there's anyway to compile a program with TCP IP commands?
Kind regards,
Eduardo
2 Comments
Eduardo Díaz Díaz
Eduardo Díaz Díaz on 2 Feb 2021
Hi Darshan!
Thanks for you answer! As Waster mentioned below, the computer with MATLAB must be the server and therefore I cannot use the tcpclient instruction.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Feb 2021
tcpclient() is for networkrole 'client', not 'server', and cannot be used to replace the 'server' role.
There is a File Exchange contribution for TCP that uses third-party code.
1 Comment
Eduardo Díaz Díaz
Eduardo Díaz Díaz on 2 Feb 2021
I have just seen this problem... As tcpip command does not support code generation I do not see any other way to do it...

Sign in to comment.

More Answers (0)

2022世界杯八强谁会赢?


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Baidu
map