Using the PLBCGI Command


 

The PLBCGI command interfaces between the PL/B Automation Server and the CGI interface of a Windows Web Server.

 

When the PLBCGI command is invoked, it creates a PL/B Automation Server program object and executes the Run method using the command line used with the PLBCGI command:

 

PLBCGI -g400 test1

 

will send the command line:

 

-g400 test1

 

Once the Run method has been executed, the PLBCGI command uses the EventSend method to transmit the data contained in stdin. For every block of 200 bytes, an event with an eventId of one (1) and one VT_BSTR parameter will be sent to the server program. The VT_BSTR parameter will contain the data.

 

When all the data has been sent, an event with an eventId of two (2) will be sent to the server program.

 

The PLBCGI command will then wait for the Exit event from the program object. For every UserEvent1 received, the PLBCGI command writes the contents of argument1 to stdout. Once the Exit event is received, the PLBCGI command terminates.

 

The following is a sample PL/B program that interacts with the PLBCGI command:

 

Data

Dim

200

 

 

 

 

WinShow

 

 

Display

*ES

 

EventReg

Client,1,GotData,ARG1=Data

 

EventReg

Client,2,SendBack

 

Loop

 

 

EventWait

 

 

Repeat

 

 

Stop

 

 

 

 

GotData

 

 

 

Display

Data

 

Return

 

 

 

 

SendBack

 

 

 

EventSend

Client,1,ARG1="Line 1

 

EventSend

Client,1,ARG1="Line 2

 

Keyin

All Done: ",Data

 

Stop

 

 

This program displays any received stdin data. Upon completion of receiving all data, the program will send back two lines of data to be placed in stdout. It will then terminate.

 

 

See Also: Automation



Compiler and Runtime Options Using VBScript as a Client Using the PLBCMD Command