Author Topic: Controlling PLC via Web Browser, LCD Display  (Read 13129 times)

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Controlling PLC via Web Browser, LCD Display
« on: September 03, 2014, 01:56:13 PM »
I've been working with the "Controlling PLC via Web Browser" scripts that is described in the "Frequently Ask Questions" portion of forum.

I've noticed that the LCD portion of the web page uses a variable pitch font and left justifies the LCD strings. This makes the Web version of the 4x20 display not look very much like the LCD.

I found that I could fix the font issue by adding the line to this section of the "0-C001-01.html" file:

.LCDline {
   background-color: #FFFFCC;
   border: solid 1px #FFFFCC;
   color: #000000;
   font-family: Courier;
   position: absolute;
   width:400px;
   height:20px;
}


So now my question, "Is there a way to specify that the LCDline text is not to be stripped of white space and left-justified?"

The attached jpeg shows the web page and what the LCD should look like.

Gary D
« Last Edit: September 03, 2014, 01:56:45 PM by garysdickinson »

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:Controlling PLC via Web Browser, LCD Display
« Reply #1 on: September 03, 2014, 01:58:42 PM »
This is the image mentioned in the previous post.

I've pasted the "expected" image from the On-Line Monitor for reference.
« Last Edit: September 03, 2014, 02:00:17 PM by garysdickinson »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Controlling PLC via Web Browser, LCD Display
« Reply #2 on: September 05, 2014, 09:39:29 AM »
Thank you for the report. Yeah we forgot that HTML tends to strip off leading spaces when it renders the text string.

You can add the following line to the LCDline css:

    white-space:pre-wrap;

That should work. We will update our webpages to include this as well.

The courier font is also a good suggestion. Although the "Lucida Console" probably looks "prettier" on screen (personal preference, of course). So you can put the following into the .LCDline :

.LCDline {
   background-color: #FFFFCC;
   border: solid 1px #FFFFCC;
   color: #000000;
   position: absolute;
   width:400px;
   height:20px;
   font-family: "Lucida Console", "Courier New";
   white-space:pre-wrap;
}
« Last Edit: September 05, 2014, 09:43:44 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:Controlling PLC via Web Browser, LCD Display
« Reply #3 on: September 05, 2014, 10:17:19 AM »
Thanks for the help with the LCD formatting.  

I have another request, strings.  Is it possible to add to the sample program the ability to read/write to either a string variable (A$..Z$) or to the EEPROM$ string variables?

This would be a big plus. Commercial HMIs than can only do MODBUS can't access the string variables.

I understand that you have worked with K&E to support the TRI HOSTLINK protocol on some of their HMI systems.  I will re-read the manuals to see if these HMIs have the capability of accessing string variables.


Thanks

Gary D.
« Last Edit: September 05, 2014, 10:34:01 AM by garysdickinson »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Controlling PLC via Web Browser, LCD Display
« Reply #4 on: September 05, 2014, 10:56:55 AM »
That will require modification to the core JS scripts. We will consider this request for implementation in future.

If you want you can also make a copy of the core JS scripts and modify it and then put it inside the PLC's webserver so that it will work for your purpose. You can request a copy by emailing to support@triplc.com. The source code for the core JS is copyrighted and only made available to licensed TRi PLC users.
« Last Edit: September 05, 2014, 10:58:06 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS