Previous Topic: SOCKCONN Macro

Next Topic: SOCKSEND Macro

SOCKRECV Macro

The SOCKRECV macro receives data (via the established socket connection) from an IP application. It is used to determine the health of an application. You can specify up to three different data streams, which can then set three different return codes.

Parameters: SOCKRECV Macro

Expected Data Format

Specifies the format in which you want to receive the data. You can choose either ASCII or EBCDIC.

Wait Time

Specifies the time (in seconds) that you want to wait to receive the data.

RC

Specifies the return code for the data.

Data

Specifies the data that you want returned.

Unprintable characters, for example hexadecimal, can be entered by preceding the command with x’ and ending it with . For example, x’456703’. The data must also be separated from text with a semicolon (;).

Example: SOCKRECV Macro

In the following example, the SOCKRECV macro receives data from the open socket connection. If OK is received, a code of 0 is returned; if ERROR is received, a code of 4 is returned. The data is returned in ASCII format and the system waits 10 seconds for a response.

--------- Automation Services : SOCKRECV Macro Parameter Definition ----------- Command ===> Function=UPDATE . Data to Receive ------------------------------------------------------------. | To specify HEX data use x'cccccc'. Use semi-colon to delimit HEX and CHAR. | | For example, abcDEFghi;x'F140F24BF3' results in abcDEFghi1 2.3 | | Expected Data Format ... ASCII_ (ASCII/EBCDIC) Wait Time ... 10 (Seconds) | | RC 0_ Data OK______________________________________________________________ | | ___________________________________________________________________________ | | ___________________________________________________________________________ | | ___________________________________________________________________________ | | | | RC 4_ Data ERROR___________________________________________________________ | | ___________________________________________________________________________ | | ___________________________________________________________________________ | | ___________________________________________________________________________ | | | | RC __ Data ________________________________________________________________ | | ___________________________________________________________________________ | | ___________________________________________________________________________ | | ___________________________________________________________________________ | '-----------------------------------------------------------------------------' F1=Help F2=Split F3=OK F9=Swap F12=Cancel