News:

  • April 18, 2024, 06:20:53 PM

Login with username, password and session length

Author Topic: Example: WebServing from DoMore  (Read 20724 times)

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Example: WebServing from DoMore
« Reply #15 on: January 27, 2017, 12:44:58 PM »
I am very glad that some of you guys have been able to make use of the code. I have invested quite a bit of time in developing this code further, but have not taken the time to document the details of saving the settings, and working with buttons and indicators for an actual HMI. I wish I had the time to go through my programs and put all the info on here, but the code is full of proprietary content, and cannot be put on here without me taking the time to generify it.

I am happy to attempt to answer questions though.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Example: WebServing from DoMore
« Reply #16 on: January 27, 2017, 12:51:13 PM »
Also, Do-more can even serve up a favicon (The little icon that is found in the corner of your browser tab, like the blue H that is on this page). It takes some creative manipulation to get it into a string structure, but it does work ;D
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

Bolt

  • Hero Member
  • *****
  • Posts: 543
Re: Example: WebServing from DoMore
« Reply #17 on: December 01, 2017, 03:51:46 PM »
I'm not seeing any links or downloads of the example program?

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Example: WebServing from DoMore
« Reply #18 on: December 01, 2017, 04:03:46 PM »
It is attached to reply number 8.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

Bolt

  • Hero Member
  • *****
  • Posts: 543
Re: Example: WebServing from DoMore
« Reply #19 on: December 04, 2017, 05:31:38 PM »
Thanks.  I read the entire post before signing up the forum, and scanned back through it to make sure I wasn't missing anything members only.  Guess I need to work on my scanning skills...

I got it to work, but right now for me the concept needs more programming time than I have to devote to it.

Thank you for posting though!

Bolt

  • Hero Member
  • *****
  • Posts: 543
Re: Example: WebServing from DoMore
« Reply #20 on: January 01, 2018, 01:30:10 PM »
Alright, I'm back to working on this and have my page structured as I would like.  I could just use a little help with a button.  How can I get a button to perform an action on the PLC, preferably without changing pages?  Something simple like a oneshot bit toggle.

Bolt

  • Hero Member
  • *****
  • Posts: 543
Re: Example: WebServing from DoMore
« Reply #21 on: January 04, 2018, 06:11:58 PM »
Could you help me out with how you structured the "save new setting" button pictured in your screenshot?

As of now I have only been able to build a button, which is linked via
Code: [Select]
<a href = $"1$">, then can use the STR2INT command to find this number 1, and use it to trigger a coil on the PLC.  Then I added some info to the head of the html document
Code: [Select]
<meta http-equiv=$"refresh$" content=$"3;URL='http://" DST18:UB3 "." DST18:UB2 "." DST18:UB1 "." DST18:UB0 ":8080/0'$"> to force the browser to wait 3 seconds and then navigate away from the "command".  Needless to say, it's not as clean as I would like.

Did you use an HTML form and a submit input button, and if so, what's the behind the scene "command" going to the PLC?  Such a scenario requires the web server to process the info, and that's where I am getting lost.
« Last Edit: January 04, 2018, 06:27:58 PM by Bolt »

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Example: WebServing from DoMore
« Reply #22 on: January 04, 2018, 06:29:54 PM »
I hope to have some time soon to be able to help you out.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Example: WebServing from DoMore
« Reply #23 on: January 05, 2018, 08:44:16 PM »
Here is a much more advanced version of the WebServer that includes many other features:
-serves a sample favicon.
-has pages that automatically update variables using javascript (without reloading the whole page).
-These pages also have a timer that will re-direct the page after so many minutes of inactivity.
-There is a sample that builds the headers and then builds and streams out a csv file.
-There is a sample that will allow you to save or delete from a list of email addresses (that are formatted to work with the EMAIL instructions).
-There are several link and button samples.

I have devoted considerable time learning and developing this code. There are MANY things that could be done better, but this is where it is currently at.

I hope this will answer many of the questions that people have when building these types of apps.
« Last Edit: January 06, 2018, 01:55:19 PM by plcnut »
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Example: WebServing from DoMore
« Reply #24 on: January 05, 2018, 08:45:29 PM »
If you find neat tricks or add features, please contribute back for myself and others to learn as well :)
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

Mike Nash

  • Hero Member
  • *****
  • Posts: 636
Re: Example: WebServing from DoMore
« Reply #25 on: January 05, 2018, 09:09:09 PM »
Wow, this is pretty neat. Thanks for sharing!

Bolt

  • Hero Member
  • *****
  • Posts: 543
Re: Example: WebServing from DoMore
« Reply #26 on: January 06, 2018, 07:12:13 PM »
This is great stuff!

One thing I did on my first attempt at a web interface was add <meta name=$"viewport$" content=$"width=device-width, initial-scale=1.0$"> to the WebPagePrefix, it makes it easier to load on a phones and other small devices, changes the default zoom width or something.