Automation/Programming (REXX/HLLAPI/MCP/DDE) → Introduction to IBM HLLAPI for ZOC
| About HLLAPI |
ZOC implements the non-enhanced variant of the interface. The functions are made for 3270 and 5250 sessions, but most of them also work with other emulations such as VT220 or xterm (see the list of functions below).
ZOC's interface for coding agents, zoc-mcp, is built on HLLAPI as well.
| DLL Names |
| EHLAPI32.DLL | |
For 32-bit client programs, for use with the 32-bit version of ZOC.
| |
| EHLAPI64.DLL | |
For 64-bit client programs, for use with the 64-bit version of ZOC. | |
Both DLLs export one function named hllapi (lower case) with this prototype:
| Installation |
Note: If you copy a ZOC EHLAPI*.DLL to another place (e.g. into the folder of
your existing HLLAPI program), it still needs the files zaphod8dll*.dll and
vcruntime140.dll from the ZOC program folder. Copy them as well, or add the ZOC program
folder to the PATH environment variable.
| Sessions |
A session is only available to HLLAPI programs if the option Allow access/remote control of this session through IBM HLLAPI is enabled in Options→Session Profile→Advanced. The option is off by default.
To see a session's id in ZOC's window title, add the placeholder %HLLAPIPSID% to the window title in Options→Program Settings→Window.
| Sample Program |
To try it, start ZOC, set the emulation in
Options→Session Profile→Emulations to TN3270 and do not
connect (an empty screen with a blue status bar). Then run:
| Supported Functions |
| HA_CONNECT_PS (1) | |
Connect to a session.
| |
| HA_DISCONNECT_PS (2) | |
Disconnect from the session.
| |
| HA_SENDKEY (3) | |
Send text and keys.
| |
| HA_WAIT (4) | |
Wait until the host is ready for input.
| |
| HA_COPY_PS (5) | |
Copy the whole screen.
| |
| HA_SEARCH_PS (6) | |
Search the screen for a text.
| |
| HA_QUERY_CURSOR_LOC (7) | |
Query the cursor position.
| |
| HA_COPY_PS_TO_STR (8) | |
Copy a part of the screen.
| |
| HA_SET_SESSION_PARMS (9) | |
Set session parameters.
| |
| HA_QUERY_SESSIONS (10) | |
List the sessions.
| |
| HA_COPY_STR_TO_PS (15) | |
Write text to the screen.
| |
| HA_RESET_SYSTEM (21) | |
Reset the session parameters to their defaults.
| |
| HA_QUERY_SESSION_STATUS (22) | |
Query the type and screen size of a session.
| |
| HA_COPY_STR_TO_FIELD (33) | |
Write text into an input field.
| |
| HA_SET_CURSOR (40) | |
Set the cursor position.
| |
| HA_CONVERT_POS_ROW_COL (99) | |
Convert between a screen position and row/column. | |
In sessions with other emulations than 3270 and 5250 (e.g. VT220 or xterm), the functions 15, 33 and 40 return 10 (function not supported).
The functions cover the common cases, but not the entire specification. For example, HA_COPY_PS does not follow every combination of HA_SET_SESSION_PARMS, and HA_COPY_STR_TO_FIELD may not handle all edge cases (length versus field length).
The reference for all functions is IBM's Personal Communications 12.0 Emulator Programming (PDF).
We are very interested in your feedback. If you need something that is not implemented yet, or in case of problems, please contact EmTec support. You will get a quick and qualified response from a programmer.