The standard user interface to PreciseFlex™ Guidance Controllers is implemented as a series of web pages than can be accessed via a standard web browser. This has several advantages: simplified access from a PC, tablet or other device with a web browser; no need for a custom host application; leveraged use of Ethernet technology; and intrinsic support for remote access via the Internet. With the introduction of Javascripts and other advancements in web technology, very elegant user interfaces can be developed using standard software tools.
In order to implement this user interface, each Guidance Controller contains a built-in embedded web server and a series of standard web pages that are distributed as part of the operating system software.
In this section, we describe the special web features that can be utilized to develop custom web pages. By employing these special features in combination with standard web HTML / Javascript technology, custom web pages can be developed that augment the standard pages provided by Brooks or replace the standard Brooks pages for most or all operations.
One note of caution. Web page development does required special knowledge and training. If you are not familiar with web page development, you should anticipate a learning curve of from a few weeks to a few months. Also, the web pages necessary for motion control must often be dynamic in nature rather than the static pages that are most often seen on the Internet. This section assumes that the reader is familiar with web page development. This is not a general tutorial for those unfamiliar with web technology.
To assist in familiarizing yourself with dynamic web page development, in this section we include a list of the off-the-shelf products that Brooks utilized in the develop of the system interface. Also, we encourage you to study the standard system web pages that are provided with your controller. There are both simple and complicated web pages that illustrate a number of techniques that are useful for dynamic web page development.
Web Server and Web Pages
The embedded web server contained in the controller system software executes in its own thread. Therefore, its operation is separate from the various Ethernet drivers. The web server operates by responding to requests from a web client, which is typically a browser executing on a PC. The web server responds to requests by returning web page files. Some of these files contain only standard static HTML data. Other files have dynamic content and have a ".asp" file extension.
When the web server encounters a file with a .ASP extension, it scans the file looking for server (controller) side Javascript procedures that must be executed before the file is transmitted. Often, these procedures alter the contents of the web file to include real-time data.
To indicate a server (controller) side Javascript procedure, all such functions are bounded by "<%" and "%>" as is the standard convention. For example:
<% aspRDB(420,1,0,0,0); %>
Whether web files are static or dynamic, they are only transmitted one time in response to a request from a web client (a browser). If the client wishes to continuously update dynamic data, it is the responsibility of the client to periodically retransmit a new request for the same file. Operations such as automatic retransmission requests are typically implemented using Javascripts that are contained in the web page and executed in the web client.
The web server is single threaded and processes web requests one at a time. Each web request is processed to completion before the next request is serviced.
Remote Procedure Calls
The server side Javascript procedures provide a very convenient means for reading dynamic data that the controller automatically updates, such as axis positions and digital I/O states. However, for more complicated interactions, such as writing a series of values to the controller and reading a computed response, the Javascript procedures can be laborious to implement and slow to execute. For these more complicated communications, in GPL 3.2 G5 and later, the web interface supports remote procedure calls (RPC's). The RPC method permits a web page to execute a GPL function on the controller, specify its arguments, and obtain a String result from the function.
The remote procedures that are invoked by the RPC method can be any user written GPL function that returns a String value. When triggered from within AJAX (Asynchronous JavaScript and XML) on a web page, the remote procedure with its arguments is executed as a separate thread within the controller. The String returned by the function becomes a value accessible to JavaScript for use within the web page. The contents of the String can consist of multiple values and can be arbitrarily complex. Remote procedure calls are specified by using the URL "/rpc" in a web page.
Remote Console Commands
In addition to RPC's, GPL 3.2 G5 and later also permit web pages to execute Console Commands. These commands are normally issued to the serial console or over a Telnet connection. This capability is similar to the server side Javascript aspConsole method, but the results are in a String than can be manipulated by Javascript instead of text embedded in the web page. Remote console calls are specified by using the URL "/console" in a web page.