Author Topic: NETCMD$  (Read 13441 times)

Lorne Van Dusen

  • Jr. Member
  • Posts: 93
  • I'm a old guy
    • View Profile
NETCMD$
« 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

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:NETCMD$
« Reply #1 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 xxx.xxx.xxx.xxx:9080>.

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.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS