PLC Code Editing - Special Magic?

donv

Member
Tried my first PLC coding tonight. I found the following code in a prior post so I went ahead and pasted that in to the PLC page and hit the Send button. Loaded OK and worked to automatically shut off output 1.
 
START
tsteq op1[1000] 1
set op1 0
END
 
I went back to look at the code (which I'd copied and pasted directly from the board post here) and noticed that the formatting was a little strange after it reloaded, it ended up looking like (note the extra space characters):
 
START    
    TSTEQ OP1[1000] 1  
    SET OP1 0 
    END   
 
Thinking this could be some artifact of the copy and paste and character sets, I edited it to get rid of the white space before and after the commands and hit the Send button again. After a while of the "Sending PLC Instructions..." with increasing dots displayed, up pops:
 
Error occured whilst sending configuration to WebControl
 
Further edit attempts failed and even got into stranger states with different error messages popping up even when loading other pages like the System Status. So I tried powering off and on again (which surprisingly reset the PLC code page to default/blank state - no PLC code retained?) and retrying the above (except removing the white space from the code before hitting Send at all) with the same result.
 
So what am I missing? From other posts it looks like other folks just enter code, Send, test and then edit and re-Send until they finish.
 
I have a brand new HW 2.2.2 board with v03.02.17f FW. I'm using FF 25.0 on Linux host to access the WebControl web pages.
 
I have the same problem with one of my boards,I just remove power (not board reset)and power back up this way i don't loose my settings
 
Possible issue is the browser not IE.  We heard a few different browser handle Java code differently, so they might have problem running GUI code on Firefix or Chome.  Since only during configuration time and display PLC code browser require with Java handling capability, it should not be a problem for most users. However, if Firefox or Chome is the only browser you have, you will need to reduce security level and Java safety check, because Firefox and chrome browser falsely considered our Java code as dangerous and not execute them in the background.
 
The display difference when reading back from the board is normal. That is the PLC program stored in the chip being feedback to browser. Since the code stored inside are all upper case, and without indent, it might not display exactly like you formatted, but no change to program.
 
When the board is reset by shorting the reset jumper and reboot, the board is totally restored, all the stored information will be wiped out. That is called factory reset, for the board go back to refresh state, just like a new board coming out factory.
 
Thanks for the reples. See below.
 
pittom said:
I have the same problem with one of my boards,I just remove power (not board reset)and power back up this way i don't loose my settings
Thanks. So should I read this also the other way around, i.e.: you have other boards which don't exhibit this behavior?
 
CAI_Support said:
Possible issue is the browser not IE.  We heard a few different browser handle Java code differently, so they might have problem running GUI code on Firefix or Chome.  Since only during configuration time and display PLC code browser require with Java handling capability, it should not be a problem for most users. However, if Firefox or Chome is the only browser you have, you will need to reduce security level and Java safety check, because Firefox and chrome browser falsely considered our Java code as dangerous and not execute them in the background.
 
I don't think Firefox is the issue. Note that entering the PLC code the first time with Firefox worked, if it is a java settings issue it should be consistent, right? Regardless, I've also tried IE 10 on a brand new Win 7 virtual machine and it produces the same errors when I freshly enter the PLC code as shown in my first example above. I currently can't get the board to accept any code via either OS/browser combination now without the error.
 
CAI_Support said:
The display difference when reading back from the board is normal. That is the PLC program stored in the chip being feedback to browser. Since the code stored inside are all upper case, and without indent, it might not display exactly like you formatted, but no change to program.
 
Maybe it doesn't matter, but I think you interpreted my report backwards or the explanation seems strange to me if not. I would/could accept that the board would strip out white space and/or indents for efficiency in internal storage. What I'm seeing is the opposite. If I entered code without the extra white space (no trailing spaces, indents), the board added them to the displayed code it returned (at least it did while it was accepting code).
 
When you submit the PLC code it is actually not stored as text.  So when you load the browser page it is being converted back to text to display for you.  The formatting is for readability. 
 
OK, I'm totally confused. I just tried another fresh reboot of the Webcontrol after getting the errors upon edit. It came up with the prior PLC code loaded (with the added tab indents and trailing spaces). Functionally worked fine, toggled OP1 on and it reset it to off per the program.
 
Using the FF 25/Linux machine I edited the code to remove the white space and added some extra lines (see below). This update took fine without the pop-up errors and *no* whitespace was added while on the PLC code page. Popped over to the output control page and tested the outputs reset and it worked.

START
TSTEQ OP1[1000] 1
SET OP1 0
TSTEQ OP2[1000] 1
SET OP2 0
TSTEQ OP3[1000] 1
SET OP3 0
END

However, when I browsed back to the PLC code page, the whitespace was there again (START line with 4 trailing spaces, body lines with tab indent and 2 trailing spaces, END line with tab indent, 4 trailing spaces and two blank lines below)! So it appears that something different happens between the save and the code re-display with a page reload.
 
Subsequently I've run into the error situation again both from Win 7/IE and Linux/FF, I can't find any consistent pattern other than the whitespace added upon page reload (on both platforms). Sometimes I can enter fresh code and/or edit successfully from either platform, other times I get the error(s) regarding the PLC code update. Seems totally random - I wonder if I just have a marginal timing/defective board.
 
I actually had my just prior post in composition when doing some testing while yours came in.. so forgive the out of sequence posts...
 
az1324 said:
When you submit the PLC code it is actually not stored as text.  So when you load the browser page it is being converted back to text to display for you.  The formatting is for readability. 
 
Thanks. So then the added formatting I describe above is normal (START line with 4 trailing spaces, body lines with tab indent and 2 trailing spaces, END line with tab indent, 4 trailing spaces and two blank lines below)? Sorry it has taken me this long to understand that, I just haven't seen any hint of that in other posts here or in the documentation.
 
pittom, on 06 Dec 2013 - 09:39, said:
pittom said:
I have the same problem with one of my boards,I just remove power (not board reset)and power back up this way i don't loose my settings
Thanks. So should I read this also the other way around, i.e.: you have other boards which don't exhibit this behavior?
Yes i have 2 outhe boads running and have no problem 
 
Did you try clearing cache? Maybe the history and cache are full or being used for whatever reason.
 
Space and tab are ignored during storing the PLC code inside. However, when display, our code added some tab to help easy reading, it may not easy for everyone, but that is the intention.
 
Back
Top