Author Topic: Hostlink  (Read 32000 times)

tobor0216

  • Newbie
  • Posts: 24
  • I'm a llama!
    • View Profile
Re:Hostlink
« Reply #15 on: April 30, 2011, 03:51:56 PM »
Below is the lastest code I have. The connection keeps toggeling open and closed. When the connection is open I can send something from the Elk panel and see it in D$. I removed the PRINT #4 "</>" but it seems the connection is toggeling.


PRINT #4 "<TCPCONNECT 192.168.1.101:2101>"

FOR I = 1 TO 10000
 C$ = INPUT$(4)

 IF LEN(C$) > 0
 D$ = C$
 Endif  'new command available in TRiLOGI 6.4 and higher

NEXT

IF STATUS(3) = 1
 
A = 1

ELSE
 A = 6    'connection failed,  exit function
ENDIF


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Hostlink
« Reply #16 on: April 30, 2011, 03:58:23 PM »
When the connection is still open, do not execute the PRINT #4 <TCPCONNECT xxx> again.

You may want to follow the examples in the testEthernet.PC6 program where we demo how to make a connection to the TLServer (using <CONNECT> instead of <TCPCONNECT> and require authenticated login, but the idea is the same) and check if the connection is opened. If it is open then send only command without trying to remake another connection. Only if the connection is lost then close the connection using the PRINT #4 "</>", wait for a while then re-connect again.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS

tobor0216

  • Newbie
  • Posts: 24
  • I'm a llama!
    • View Profile
Re:Hostlink
« Reply #17 on: April 30, 2011, 04:09:05 PM »
The port I am connecting to on the ELk panel does not require a user name or password. Would I leave these blank?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Hostlink
« Reply #18 on: April 30, 2011, 04:19:42 PM »
I said to refer to <CONNECT> command which is used for logging into TLServer with username and password. But since you are not connecting to TLServer you do not need to supply the username and password at all. i.e. You use the <TCPCONNECT> to connect to the ELK and that is. The rest are just a matter of sending the command and get the response. For TLServer we use the NETCMD$ which will compute the error check FOR TLSERVER. This is not to be used with your ELK server.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

tobor0216

  • Newbie
  • Posts: 24
  • I'm a llama!
    • View Profile
Re:Hostlink
« Reply #19 on: April 30, 2011, 04:32:36 PM »
I am not sure how to put this all together. Would it be possible for you to provide a sample that I can refer to. I looked at testEthernet.PC6 but am unsure which part I need to use.


Thanks,


Paul

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Hostlink
« Reply #20 on: May 02, 2011, 07:34:17 PM »
Your ELK is a third party device and is beyond the range of topic that we can provide examples. We can only suggest you look at some examples where our equipment are involved. You can also run some test to understand how the logic work in these equipment so that you can extend your knowledge in communicating with third party.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS