Via the HTTP server in the LAS you can access functions in the Programmer from a remote system. First, you have to configure and start the HTTP server in the Application options. When the configuration is finished, the HTTP server is ready for access. As there is no webpage in the server home path, you cannot see anything. But you can already trigger actions in the Programmer using a web browser. This is done through special tags inside the URL.
The basic syntax of an HTTP request is
where ServerAddress is the IP Address or domain name of the HTTP server, RequestType is the type of request you want to send and Request is the request itself. As you can see, the only difference between the lines is the use of get and xmlget respectively. This affects the style of the results that the Programmer sends back to the browser after a request. Using get, the result is in plain text. With xmlget, the result will be sent in XML, with the following layout:
<?xml version=”1.0” encoding=”utf-8” standalone=”yes”?>
<request value=”…” tag_id=”…”/>
<result value=”1” error=”0” message=”OK”/>
<result_entry value=”the first entry” />
- <?xml … standard XML header
- <xml_ecue> protocol version number for e:cue HTML
- <request> the request like it arrived at the Programmer
- <result> ‘value’ – an integer value for the result, ‘error’ – nonzero value if an error occurred, ‘message’ – error description in plain text
- <result_list> holds a list of <result_entry> – tags
- <result_entry> holds an attribute ‘value’ with results
Using get requires less result decoding effort but has a worse error handling. With xmlget,
HTTP Request Types
The CallMacro request will execute a macro in the programmer. The macro must exist inside the show.
You can also pass up to five numeric parameters, separated with commas. Examples:
http://ServerAddress/xmlget?CallMacro=MyMacro or http://ServerAddress/get?CallMacro=MyMacro,2,4,6
The ExecCommand request will execute a single line e:cript command in the Programmer:
In CommandString you can add any valid e:script command (or command sequence) like you would use inside the Programmer. You can also define global variables. Examples:
http://ServerAddress/get?ExecCommand=if (undefined(_x)) int _x;_x=10;
The AutoText request sends e:cue autotext to the Programmer. The Programmer sends back decoded autotext to the web browser as a result.
http://ServerAddress/xmlget?AutoText=<cuelist 1 status>
Using the HTTP requests by typing them directly into the browser’s address bar is too complicated for real practical applications. It is of course possible to embed the requests into a website. This is what it’s all about: create your own website with your own control elements and put it online using the Programmer’s integrated HTTP server. You can also refresh any status displays or control elements without having to reload the entire page. This is typically realized using the AJAX web development techniques.