Author Topic: Storing Web pages in Nano-10 & FMD PLCs  (Read 27195 times)

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Storing Web pages in Nano-10 & FMD PLCs
« on: February 23, 2011, 11:36:57 PM »
The Nano-10, FMD and F-series PLCs only have 60K bytes of file space to store user's control web page.

These PLCs use a very simple file system. File name can only start with one character (0,1,2,....9,A,B,C....)and can have only 3 character extension.

Each file name is allotted 2K bytes of space but each file name can occupy multiple slots, in which case it takes over the space of other files.

That means 0.xxx will occupy the first 2K bytes, 1.xxx will occupy the next 2K bytes, and so on. A file may extend beyond its own allocated file space and take over the space of its adjacent files.

E.g. 0.xxx can occupy the space of 1.xxx and 2.xxx, therefore allowing you to store a file that is up to 6K bytes long. However, that also means you cannot store any file with name 1.xxx or 2.xxx or it will overwrite the data. Your next file should occupy file name from 3.xxx onwards.

The default control web pages 0.htm is > 2K bytes but < 4K bytes, and therefore occupy the space of 0.xxx and 1.xxx. The second control web page is therefore stored at 2.htm. If you need to store your own special files, such as small JPG or CSS file, they can be stored from 4.xxx up to before N.xxx.

More complex graphics or css file can be stored on any internet or intranet webserver (or stored in the TLServer's /public folder) instead of on the CPU flash memory.
« Last Edit: February 23, 2011, 11:38:49 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ssiewert

  • Newbie
  • Posts: 13
    • View Profile
Problem Storing small jpeg
« Reply #1 on: January 11, 2013, 11:25:36 AM »
My goal is to have the background image on the Nano so I don't need internet connection or a server of any kind for storing the background.  I've shrunk the jpeg file to under 16K, and tried storing at ip:port/a.jpg and it doesn't seem to work.  Removed file, tried then at c.jpg.   When using a browser to go to ip:port/c.jpg, I get "The image ?http://10.0.1.60:9083/c.jpg? cannot be displayed because it contains errors." in Foxfire: Safari shows nothing.  A few more clues.   The jpeg file opens fine before transfering to the Nano.  It shows it was transfered fine (all 16K or so) in Filezilla.  However, when I bring it back from the Nano to a folder on the PC, it only shows a hair over 2K, so for some reason, it is getting clipped.  Oddly, it leaves a remnant after the transfer of "U.jpg" on the Nano.  The Nano has only the other user file 0.htm (about 3.5K) on it so I really can't think of how the Nano would be short space. The 16K I'd think would occupy A-H, no?  The Nano is r76a, RTC-0 is installed.  Using Trilogi 6.43 over ethernet.
Thanks
Murphy may sleep, but he never dies.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Storing Web pages in Nano-10 & FMD PLCs
« Reply #2 on: January 13, 2013, 11:47:15 PM »
The Nano r76 only supports 62K bytes of web file space. This mean 0.xxx  to 9.xxx, then A.xxx to U.xxx.  

U.JPG only have 2K bytes of space left and you can't put a 16K Jpg file at this space.

Nano-10 webpage requires the 0.htm and N.JS  (later version has been changed to M.JS). 0.htm occupies 4K, that means you can use the space from 2.xxx to L.xxx to store your JPG file. This is 20K bytes of file space which may just fit your JPEG file.

So try to rename your file 2.JPG and refer to it in your HTML file and see if this work out for you.

For PLC with r78 or later firmware you can use FRAM-RTC-256 to expand another 256K bytes of file space for storing webpage for used by the PLC for storing data into files.

« Last Edit: January 13, 2013, 11:48:55 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ssiewert

  • Newbie
  • Posts: 13
    • View Profile
Re:Storing Web pages in Nano-10 & FMD PLCs
« Reply #3 on: January 24, 2013, 08:45:19 AM »
Nano-10 webpage requires the 0.htm and N.JS  (later version has been changed to M.JS). 0.htm occupies 4K, that means you can use the space from 2.xxx to L.xxx to store your JPG file. This is 20K bytes of file space which may just fit your JPEG file.

For PLC with r78 or later firmware you can use FRAM-RTC-256 to expand another 256K bytes of file space for storing webpage for used by the PLC for storing data into files.

I see, yes I had forgotten about the N file, though I knew it was there.  I understand writing it to U would not work, I was commenting that after the described sequence, I had a weird remnant file that showed up at "U".    I'll give it a try starting at "2.xxx", though when I do the math, saving it at "A" or "C" should offer plenty of space, if the slots were actually 2k each (13x2k).  
****update- success with the 16k  jpg stored at 2.jpg****

Clarification on the use of the FRAM-RTC-256. Is it only r78 and later?  Reason I ask is the Appendix A, Extended File system gives the thumbs up to r77 and later.  Has it been discovered r77 has limited functionality since 2011 when Appendix A looks like it was written?
« Last Edit: January 24, 2013, 01:30:29 PM by ssiewert »
Murphy may sleep, but he never dies.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Storing Web pages in Nano-10 & FMD PLCs
« Reply #4 on: January 24, 2013, 01:42:27 PM »
Extended file system works fine on Nano-10 and FMD PLC from r77 onwards.

Extended file system on F-series PLC (F2424 and F1616-BA) only works on firmware version r78B onwards.

A bug was discovered in the F-series firmware r77, r78 and r78A rendering it unable to create file > 4K bytes. This bug was fixed in r78B onwards.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS