Browser Client URL
The Broswer URL logon string logs the client onto the PL/B Web Server and initiates the execution of a PL/B program. The Browser URL logon string is composed of five (5) components formatted as follows:
(1) {Ip|Url}:{portnum}/{prgname}[?[runopt={runopts}][cmdline={prgopt}]
(2) {Ip|Url}:{portnum}/{htmlpage}
Where:
Examples of Browser URL logon strings using format (1):
http://127.0.0.1:8081
A simple URL logon string that causes the PL/B Web Server to execute a PLC program based on the PLBWEB_DEFAULT keyword setting. If the PLBWEB_DEFAULT keyword is not defined or it is assigned to be null, the PL/B ‘answer.plc’ program is executed at the PL/B Web Server with the PL/B Answer\Master concept applied. Otherwise, the PL/B Web Server executes the PLC program assigned to the PLBWEB_DEFAULT keyword with the PL/B Master concept applied.
http://192.168.1.105:8081/master.plc
This URL logon string causes a logon to a workstation on a network where the PL/B Web Server has been installed. In this case, a ‘master.plc’ program is executed.
http://www.sunbelt-plb.com:8081/answer.plc?runopt=-mv3000000
This URL logon string causes a logon to a PL/B Web Server executing on the Sunbelt Server. In this case, a ‘answer.plc’ program is executed. The ‘-mvNNNNNN’ runtime option changes the PL/B program memory space used to execute the program.
http://127.0.0.1:8081/answer.plc?cmdline=parm1=5,%20Next&runopt=-dr
This URL logon string causes the PL/B ‘answer.plc’ program to be executed at a PL/B Web Server which is installed on the same workstation where the browser is executing. When the ‘answer.plc’ program starts executing, the S$CMDLIN global variable is loaded with the ‘cmdline’ options string of “parm1=5, Next”. Please notice that the ‘%20’ represents a white space or blank as stored into S$CMDLIN. In addition, the runtime option as specified for ‘runopt=‘ is set to ‘-dr’. The ‘-dr’ option is being used to start a GUI debug session using the GUI ‘DBGIFACE.PLC’ debugger which was previously loaded and available for debugging a PL/B program. When using the '-dr' option to invoke a GUI debug session, see the PL/B Runtime Reference keyword named 'PLBDBG_LOGON' for keyword setup details.
Examples of Browser URL logon strings using format (2):
http://www.sunbelt-plb.com:8081/mypage.html
This URL logon string causes a logon to a PL/B Web Server executing on the Sunbelt Server. In this case, a HTML web page file named 'mypage.html' is downloaded to a client browser and executed. The following HTML\Javascript web page shows very simple coding to invoke a PWS PLB program after downloading the 'mypage.html' from a 3rd party Web Server.
Using HTML web page with HTTP GET request:
In this case, the following HTML page uses a HTTP GET request to logon to a PWS server when the submit operation occurs and the JavaScript document 'submit' instruction executes. Also, the 'runopt' and 'cmdline' data is added to the URL command by the client browser when the URL command is sent to the PWS server which executes the program 'userprog.plc'. In this case, the 'runopt' and 'cmdline' data appears in the browser URL command.
<html>
<head></head>
<body>
<form id="myForm" action=" http://www.userpws.com:8081/userprog.plc" method="GET" >
<input type="text" name="runopt" value="-g100000" style="display: none">
<input type="text" name="cmdline" value="Edward;MyPassword;More upto 250 bytes!!" style="display: none">
</form>
<script>
document.getElementById("myForm").submit();
</script>
</body>
</html>
Using HTML web page with HTTP POST request:
In this case, the following HTML page uses a HTTP POST request to logon to a PWS server where the submit operation is performed using a JavaScript instruction. Also, the 'runopt' and 'cmdline' data is submitted in the HTTP POST request without being shown to the end-user in the browser URL command.
<html>
<head></head>
<body>
<form id="myForm" action=" http://www.userpws.com:8081/userprog.plc" method="POST" >
<input type="text" name="runopt" value="-g100000" style="display: none">
<input type="text" name="cmdline" value="Edward;MyPassword;More upto 250 bytes!!" style="display: none">
</form>
<script>
document.getElementById("myForm").submit();
</script>
</body>
</html>
See Also: PL/B Web Server Command Line
![]() |