Connecting by using HLLAPI

Learn the requirements and steps to connect to the terminal emulator with terminal providers that implement the High-level Language Application Program Interface (HLLAPI) standard. In IBM RPA, you can use these providers to start and connect to host sessions over 3270 and 5250 protocols.

Before you begin

As prerequisite you must have a terminal emulator provider that implements the HLLAPI standard, and provide the HLLAPI DLL in that provider.

HLLAPI DLLs supported:

  • IBM® Personal Communications: pcshll32.dll

You must have an active session opened in the terminal emulator provider to connect by using HLLAPI.

Procedure

You can use the IBM RPA Studio's recorder to connect with the HLLAPI standard as a provider, or add the Connect to Terminal (terminalConnect) command directly to your script.

In the connections' fields, select HLLAPI, and enter the HLLAPI DLL path and session ID. The session ID is the name of the terminal session window.

In the following example, the Connect to Terminal (terminalConnect) command connects to a terminal emulator over 5250 protocol with IBM® Personal Communications provider through the HLLAPI standard. The session defined must be started in IBM® Personal Communications before you run this example.

defVar --name terminalName --type String --value Terminal
defVar --name connectionSuccess --type Boolean
defVar --name sessionId --type String --value A
defVar --name hllapiDll --type String --value "C:\\Program Files\\IBM\\Personal Communications\\pcshll32.dll"
// Connects to a terminal emulator over 5250 protocol with IBM Personal Communications provider through the HLLAPI standard.
terminalConnect --name "${terminalName}" --provider "HLLAPI" --sessionid "${sessionId}" --dllpath "${hllapiDll}" connectionSuccess=value
if --left "${connectionSuccess}" --operator "Is_True"
	// Logs a message in IBM RPA Studio if the connection is established.
	logMessage --message "Connection to the \"${sessionId}\" host session established." --type "Info"
endIf
// Disconnects from the terminal.
terminalDisconnect --name "${terminalName}"

If you use the terminal recorder and lose the connection, you can click the Terminal is disconnected. Click here to reconnect... button to reconnect with the same credentials.
However, if you aren't connected and enter an incorrect credential, that button prompts you to enter new credentials.

In versions before 23.0.7, the terminal recorder uses the same credentials to reconnect. In this case, restart the terminal recorder to provide new credentials.

What to do next

Learn how to record screen data from the terminal emulator based on the actions that you take on it and how to inspect fields on it. For more information, see Recording actions on the terminal emulator and Inspecting fields with the recorder.