Author Topic: Javascript  (Read 11529 times)

BC SYSTEMS

  • Full Member
  • Posts: 146
    • View Profile
Javascript
« on: November 08, 2012, 12:56:46 PM »
Hi,

I'm looking for some webpage help from the support team and the forum community.....

I have modified the standard web pages to suit my needs and I'm having a intermittent issue with the communication.

The page works really well except for the fact every now and then I get a PLC communication JS alert.  I think it has something to do with the communication call vs response latency but cannot pin it down.

The page can run all day without any issues locally or accross the web but then.....bingo comms error.  we have added a refresh after the error alert to get it all going again but its only putting a plaster on things.

 I appreciate that JS issues are not supported and modifications to the standard files are at your 'own risk' as such but I wanted to see if any other users had any JS experience they could share.

I have (against your advice  ;D) removed the JS file and merged the HTM and JS file into one file.  

The web files and program are attached.  Its a simple time clock program with some fields for entering on / off times of the PLC output with a force option and LCD display.

Anyone with a Nano or F series PLC can install the we page and program and have a go.....  We have a bar graph which also works well.

There are a lot of parts of the HTM file commented out as I'm still testing this and will remove and tidy when I'm done but as said it suits our needs perfectly.

Any JS support welcomed  ;)

Cheers Marcus

BC SYSTEMS

  • Full Member
  • Posts: 146
    • View Profile
Re:Javascript
« Reply #1 on: November 09, 2012, 03:49:46 AM »
HI,

 I have merged my modified functions with one of the original functions which seams to help although I don't get my pop up alert now..

function errormsg(txt){alert("Connection Failed:\n"+txt)}  
function checkSvrResp(xmlobject, from){
   if (xmlobject.status!=200 || xmlobject.responseText==""){
     svrOK=0;drawMsgColor("Server Error!","red");
    errormsg("Communication to remote PLC failed"); // added
     return 0
   }  
else {svrOK=1;return 1}
}