Internet PLC Forum

General => Technical support => Topic started by: Lorne Van Dusen on March 01, 2019, 12:15:12 PM

Title: NETCMD$
Post by: Lorne Van Dusen on March 01, 2019, 12:15:12 PM
I need someone to clarify something for me.
If in my program I am using the NETCMD$(2, _____)to send or receive information in and out of port 2
It's my understanding from reading the manual that the Ethernet can use the vertual COMM port #4
Do I just change the statement to NETCMD$(2,____) to NETCMD$(4,____ for all the NETCMD's
Title: Re:NETCMD$
Post by: support on March 02, 2019, 01:46:28 PM
Unlike serial port connecting via Ethernet is not a one to one. All Ethernet communication are made via virtual connection channel established in a shared medium.

So you must first make a  connection to the server using the PRINT #4 "<CONNECT>.

You have to verify that the connection is successful. After the connection has been established, you can the communicate with the slave using the same NETCMD$ command and yes you can just replace the comm port #2 with comm port #4 and all the commands are identical.

Your program should also monitor the connection and stop the communication if the socket connection has been lost with the server.