Author Topic: virtual LCD display  (Read 6659 times)

StefanA

  • Newbie
  • *
  • Posts: 29
  • I'm a llama!
    • View Profile
virtual LCD display
« on: November 16, 2012, 08:34:27 AM »
I can't display a string returned from the The NANO-10 plc on the virtual LCD screen. It shows up on the online-monitor LCD but not on the web page display. I want to check that a text file transfer is complete by getting  a <OK> from the plc.

I also have some trouble understanding how the timer functions work.  I use the timerPV command in a function and  when the timer reaches 0 the timerbit goes high. How do I reset the timerbit? I tried using the settimerSV and clrbit command but it won't work.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:virtual LCD display
« Reply #1 on: November 16, 2012, 11:57:15 AM »
On the webpage display it is only updated when the "Refresh" button is pressed or if the "Continuous update" checkbox is selected.

You can clear a timer bit from within the custom function by using the CLRIO  command. So the timer contact has to trigger a custom function in order to clear its contacts.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

StefanA

  • Newbie
  • *
  • Posts: 29
  • I'm a llama!
    • View Profile
Re:virtual LCD display
« Reply #2 on: November 17, 2012, 04:17:00 AM »
I have continuous update so that's not the problem. It seems as the  virtual LCD display can't handle symbols like > <. I tried display the text: One <two> three, and it won't display the <two> part.

I can't reset  a timer(bit) started with timerPV as long as it value is 0. Start the timer again and under the time it's running you can clear the bit but not when it's reached zero.  

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:virtual LCD display
« Reply #3 on: November 19, 2012, 11:28:33 AM »
The M.JS program didn't convert the special characters "<" and ">" into HTML equivalent and therefore anything between these two HTML tag characters are not displayed. If you wish to display these characters, do the following to the M.JS file:

1) Add the following function:

function cvSpecial(txt) {
  return txt.replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
}

2) modify the following line in the "drawRect" function:

 else el.innerHTML = "<div style='"+styleStr+"'>&nbsp;" + cvSpecial(txt) + "&nbsp;</div>"
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:virtual LCD display
« Reply #4 on: November 19, 2012, 11:35:09 AM »
Regarding the timer bit, as long as the timer ==0 (time out) the timerbit will be set. This is how a timer should behave.

If you want to disable a timer altogether and assuming it is not controlled in the ladder program, you can set:

TIMERPV[1] = -1

This disable the timer and you can also clear its contact.

If you are staring a timer within a custom function, then you just set the timerPV first followed by CLRIO and the timer will then start to count down correctly and the contact will turn on when time out.
« Last Edit: November 19, 2012, 11:37:50 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS