Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: BobO on October 04, 2018, 05:50:22 AM
-
We are digging into what we might want to add to BRX through a web interface and would love to have input from our users!
Some ideas we are kicking around now are:
1. Web pages for:
a) Basic system status...pretty much anything currently available from the SysInfo dialog pages in DmD.
b) File system access...minimally file listing and file read access to the ram and sdcard disks. I have mixed emotions about writing or deleting.
c) Basic image register data display. This is somewhat redundant to 2C below, one being browse-able the other more programmable. May not need both.
d) ??
2. REST API for:
a) Running program blocks. Something like /run/PgmBlockName?parameter_fed_into_string_containing_whatever_you_want
b) Reading image register locations and returning as JSON object records. Something like /data/json?FieldJuan=V0&FieldToo=T0.Acc&Field3=D[V1]:3
c) Reading image register locations and returning as live web page table. Similar to json, like /data/page?FieldJuan=V0&FieldToo=T0.Acc&Field3=D[V1]:3
d) ??
We're listening!
-
And for those who have no clue what a REST API is, basically it is a means of using HTTP URLs as function calls. So rather than reading documents, you are issuing commands or requests for services.
Here's an example that happens to already be running on the DMSim. ;) In this example, I am issuing a command to the PLC via a web browser, asking it to send me the current value of some element references formatted as a JSON record. Note the request at the top of the browser, and the response in the browser window. Just getting started, but this will give you an idea of what is possible.
-
On the HTML access, I have seen other equipment and web page interfaces use brackets in the format [variable] for simple display of of data in HTML, since html ignores the brackets. As long as you could handle the nesting of brackets for array access. I would like to see something like that where I could use a simple HTML editor and insert data into the page.
Any chance for adding an FTP server for files on the memory card?
-
On the HTML access, I have seen other equipment and web page interfaces use brackets in the format [variable] for simple display of of data in HTML, since html ignores the brackets. As long as you could handle the nesting of brackets for array access. I would like to see something like that where I could use a simple HTML editor and insert data into the page.
Any chance for adding an FTP server for files on the memory card?
For an initial feature, I don't envision user definable pages via direct HTML generation. We will likely do an instruction that will allow you to define a small number of pages from PLC code (which will generate HTML) and those will definitely allow embedding data.
FTP is not a priority right now, but HTTP will give you rudimentary access.
-
I would like to see simple HTML user defined pages with embedded data. Using them on another controller. Techs love them. Great diagnostic tool where there is no HMI.
-
I would like to see simple HTML user defined pages with embedded data. Using them on another controller. Techs love them. Great diagnostic tool where there is no HMI.
The instruction I'm proposing will allow you to create tables of live fields with descriptions. Does that not accomplish the same thing without the complexity?
-
Sure. Would it be one instruction/html page or one page encompassing all tables?
-
An instruction would configure a page, and the system would support some arbitrary number of simultaneous pages. Since it is code, the pages could be reconfigured at will.
I'm thinking each page could be configured with 30+ lines. Still chewing on line content, but some combination of descriptive text and tag data, read for certain, and maybe write. We're not looking to replace an HMI (which we hope to build some day) but to provide exactly the kind of diagnostics access you are describing.
-
This sounds a lot like the HMI IN YOUR POCKET I proposed a while back to provide access for setpoints on a PLC where you don?t really need an HMI. Except it looks like you wouldn?t need an app?
-
Also, It would be nice down the road to have a dedicated memory structure with defined arrays of DINTS , REALS and STRINGS to edit configuration data via a web page. Nothing big, maybe 5-10 each? Anything more, you need an HMI. Nothing too fancy. Enough for the end user to setup IP addresses and limited configuration data.
-
I have built a fairly extensive webpage that is hosted on a local server. I access all the data from the BRX via php commands to get the modbus data into arrays, and then build my web pages with those arrays. It's a little bit of work to set up, but once working, it's rock solid. Using it, I can read I/O and register values, control coils and set register values, etc. I also post allot of data to an SQL server, which can then run historical charts, tables, etc. At this point, I'm trying to build everything into web pages, and not need any HMI's. With a php page obviously the data is not current after page load, but I think I could accomplish that with some java modbus libraries.
I would happily welcome any web capabilities. Having API capabilities would help a bunch in polling data from various registers, vs putting them all into modbus, and having to slice and dice all the data into the necessary formats on my web pages. I would like to see allot more than 30 lines be populated into an array though.
Having more capabilities into the BRX would really streamline things greatly. Ideally I would like to see the web server be run entirely on the BRX, greatly cutting back on the hardware and supporting devices needed in a new setup. There may or may or may not be a patent on that?
-
And for those who have no clue what a REST API is, basically it is a means of using HTTP URLs as function calls. So rather than reading documents, you are issuing commands or requests for services.
Here's an example that happens to already be running on the DMSim. ;) In this example, I am issuing a command to the PLC via a web browser, asking it to send me the current value of some element references formatted as a JSON record. Note the request at the top of the browser, and the response in the browser window. Just getting started, but this will give you an idea of what is possible.
Is this REST API available yet? Retrieving current values from PLC and returning in JSON format? If so, is there any example code?
-
Is this REST API available yet? Retrieving current values from PLC and returning in JSON format? If so, is there any example code?
We are launching new products this Fall, and API will be in the associated release.
No example code necessary. It's just an HTTP GET.
-
Can you speak to what these new products are?
-
Can you speak to what these new products are?
With the caveat that unreleased products are subject to change...and from memory...
1. Several new discrete modules, including some TTL versions
2. BX-HSIO4 - line driver version of HSIO that operates at 2MHz in and out.
3. A new POM that implements a second full Ethernet port. Supports everything the built in port does.
-
We are launching new products this Fall, and API will be in the associated release.
Excellent!
Any possibility of sending bits and bytes to the PLC via an API? Perhaps sandboxed like MC and MHR, et al?
-
Been chewing on this web service idea, but i don't have access to DmD at the moment. What can the json instructions do.
Been doing a lot of work with web app design and I wonder how much you could actually run client side via JS and have the DoMore serve the html static and a small JS file that handles all the major lifting from the browser.
Something along the lines of a static HTML / JS you'd upload into the cpu filesysyem and then the broswer would then update to and from cpu via JSON.
-
Been chewing on this web service idea, but i don't have access to DmD at the moment. What can the json instructions do.
Been doing a lot of work with web app design and I wonder how much you could actually run client side via JS and have the DoMore serve the html static and a small JS file that handles all the major lifting from the browser.
Something along the lines of a static HTML / JS you'd upload into the cpu filesysyem and then the broswer would then update to and from cpu via JSON.
The JSON instructions are for building and parsing JSON records.
The API returns PLC data as JSON records, appropriate for JavaScript running on the client. Our current plan is to roll out the API and initial web server this fall, and then next year roll out an instructions for generating user web pages that will heavily use JS to drive client side stuff.
-
Excellent!
Any possibility of sending bits and bytes to the PLC via an API? Perhaps sandboxed like MC and MHR, et al?
Not in the initial release, but it is something we want to do. One of our concerns was exposing everything via the API, but I like the sandbox idea. We will probably use some form of API key as well.
-
Been chewing on this web service idea, but i don't have access to DmD at the moment. What can the json instructions do.
Been doing a lot of work with web app design and I wonder how much you could actually run client side via JS and have the DoMore serve the html static and a small JS file that handles all the major lifting from the browser.
Something along the lines of a static HTML / JS you'd upload into the cpu filesysyem and then the broswer would then update to and from cpu via JSON.
There's always plcnut's method of web serving: https://forum.hosteng.com/index.php?topic=1117.0 (https://forum.hosteng.com/index.php?topic=1117.0)
-
Excellent!
Any possibility of sending bits and bytes to the PLC via an API? Perhaps sandboxed like MC and MHR, et al?
Not in the initial release, but it is something we want to do. One of our concerns was exposing everything via the API, but I like the sandbox idea. We will probably use some form of API key as well.
Please do!
-
Does that mean that the new POM would also be 10/100 Mbps?
-
Does that mean that the new POM would also be 10/100 Mbps?
It is.
-
The JSON instructions are for building and parsing JSON records.
The API returns PLC data as JSON records, appropriate for JavaScript running on the client. Our current plan is to roll out the API and initial web server this fall, and then next year roll out an instructions for generating user web pages that will heavily use JS to drive client side stuff.
This sounds exciting.
-
Any update on being able to send bits and bytes to the PLC via the Web API? I can read from the API but I cannot change the values so I can interact with the plc code.
-
Any update on being able to send bits and bytes to the PLC via the Web API? I can read from the API but I cannot change the values so I can interact with the plc code.
We do plan to add it, but the primary concern is how to do it securely. Since (for now) the webserver isn't encrypted, we have concerns that even using an API key or something like that is still too exposed.
-
Thanks, hopefully soon we will get there.