Author Topic: JAVA Server API  (Read 13185 times)

Zelphia

  • Newbie
  • Posts: 13
    • View Profile
JAVA Server API
« on: June 16, 2007, 11:58:04 AM »
I have written an ethernet to serial bridge for a Dallas/Maxim TINI microcomputer.  It passes the data directly from the ethernet port to the RS232 port and vice versa once a network connection has been made.  When I try to connect (using Trilogi 6.12 or ExcelLink) ConnectTLServer.commAction() throws an exception because it can't complete the username/password handshaking.  At least I think that is what's happening.   Can you supply me with a Server API or maybe some code examples of how my server needs to reply to the client attempts to log in?

Thanks,
Bpaige@alaska.com
« Last Edit: December 30, 2009, 11:03:21 PM by Zelphia »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:JAVA Server API
« Reply #1 on: June 18, 2007, 12:34:12 PM »
TRiLOGI log in sequence will send the following:

GET /TLcomm HTTP/1.0

followed by two CR-LF

It will then send the username and encrypted password, each followed by CR-LF.

Your server must respond a "0K-1" followed by CR-LF so that the TRiLOGI or ExcelLink software will take it that the server has accepted the log-in.

You may want to use a packet sniffer to examine the login sequence between the TRiLOGI and TLServer for the precise log-in sequence.


« Last Edit: June 18, 2007, 12:35:01 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Zelphia

  • Newbie
  • Posts: 13
    • View Profile
Re:JAVA Server API
« Reply #2 on: December 30, 2009, 03:39:14 PM »
I have dusted off this old project and need some more help.  I followed your advice and now the following commands from the Trilogi Controller menu work:

Select Controller
Connect to Server
Open Matching Source File
Get PLC's Hardware Info
Set PLC's RTC
EEPROM Manager (Read and Write Integer and Strings)

These commands do not work:

Online monitoring
Program Transfer to PLC

A framing error is reported by the PLC and Trilogi requests that I verify that the PLC with the correct ID is connected.

Do these commands require some response from the server before the communication takes place with the PLC?  I have monitored the activity with a packet sniffer but I don't recognize some of the interaction.  If you can offer any advice I would be very grateful.  Thank you for your help.
« Last Edit: December 31, 2009, 01:20:16 AM by Zelphia »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:JAVA Server API
« Reply #3 on: January 05, 2010, 11:09:54 AM »
Could your PLC be writing data out of its serial port? If that is the case it will disrupt online monitoring attempt.

You can pause the PLC using DIP switch #4  and then try to go online monitoring. Note that if you re-boot the PLC with DIP Switch #4 ON then the COMM1 on M-series PLC become 9600,8,1,n and you need to modify the setting on TLServer.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Zelphia

  • Newbie
  • Posts: 13
    • View Profile
Re:JAVA Server API
« Reply #4 on: January 05, 2010, 01:46:00 PM »
The PLC code has no comm activity.  It simply consists of 5 inputs that when active drive 5 outputs to the on state.  There are no custom function blocks.  The server passes everything that appears on the ethernet port directly to the RS232 port and returns everything that appears on the RS232 port to the ethernet port with no modifications.   I will give your suggestion a try when I get home next week.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:JAVA Server API
« Reply #5 on: January 05, 2010, 03:11:25 PM »
By "Server" do you mean the TLServer or the server software on the TINI computer that you wrote? I was referring to the TLServer.

If you are using the bridge that you wrote it won't work with i-TRiLOGI software. There are two reasons:

1) i-TRiLOGI goes through a login sequence with TLServer. Your transparent bridge does not handle the login sequence and therefore i-TRiLOGI will not connect to the server.

2) i-TRiLOGI combines a number of host link command in a big packets and when TLServer receive the packet, it then strip each command from the single receive packets and dish them out one by one to the PLC and assemble the response from PLC and send back to the i-TRiLOGI software, again in a big packet. This is to reduce the two way network delay if command is send one at a time and response is received one at a time. Your server will not be able to handle this.

You can purchase an XServer to go with the PLC if you wish to connect it online. Or move to the F-series PLC which has built-in Ethernet server.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Zelphia

  • Newbie
  • Posts: 13
    • View Profile
Re:JAVA Server API
« Reply #6 on: January 05, 2010, 06:27:18 PM »
Thanks for the thorough explaination.  
I am refering the the server running on the TINI computer.  It intercepts the "GET /TLcomm HTTP/1.0" and username/password strings from Trilogi and replies with "HTTP/1.0 200 OK\r\nServer: TLServer/Ver 1.0 Jan 2001\r\nConnection: close\r\n\r\nOK-1\r\n".  It then intercepts the "IR*" request from Trilogi and replies back with "IR01*\r\n".  Trilogi is then happy with the connection and as mentioned earlier all of the other commands work.  All other traffic is passed directly out the RS232 port to the PLC.   I was hoping to get enough detail from you to be able to program my server to work with the 'online monitoring' and 'program download' commands.   If you can help me with that I would be very happy.  Thanks again.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:JAVA Server API
« Reply #7 on: January 05, 2010, 08:48:24 PM »
Sorry, this is beyond regular tech support as helps for programming 3rd party server is not part of our work. You could use a packet sniffer to analyze the traffic and mimic the communication.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Zelphia

  • Newbie
  • Posts: 13
    • View Profile
Re:JAVA Server API
« Reply #8 on: January 06, 2010, 06:53:24 AM »
Ok.  Thanks for the help to date.