HPlogo SNA IMF Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 2 Using SNA IMF Intrinsics

Intrinsic Calling Sequences

» 

Technical documentation

» Feedback

 » Table of Contents

 » Glossary

 » Index

The order in which you call SNA IMF intrinsics depends on whether your device or the host system will be the first to send data after a communication path is opened. If the host has a screen of data waiting for you, the host will want to send the screen before allowing you to send any data. If the host system requires you to log on or start the host application, your device must send the first screen of data to the host system.

You can simplify your program by developing routines that consist of commonly used sequences of intrinsics. Be sure these routines check the value returned in the result parameter of each intrinsic. Appendix F “Sample Programs” contains complete sample programs.

Following are suggested intrinsic sequences, presented to help you get started writing your programs. You may want to run Pass Thru with the format parameter in the info string set to three or four (the automatic print option), to verify the correct intrinsic calling sequence. See Using SNA IMF Pass Thru for more information.

Host Transmits Data First

If you expect the host to send data to your device first, use intrinsics in a sequence like this:

Establishing communications with the host:

OPEN3270

Establish communications with the host system.

RECV3270

Check to see if the data has been received.

RECV3270

Accept an initial screen of data from the host.

SCREENATTR

Determine the number of fields in the screen and update the cursor variables containing the coordinates of the cursor position.

Reading data, from a specified field:

FIELDATTR

Determine the attribute values for a specified field.

READFIELD

Read data from a specified field in the screen.

(Repeat the FIELDATTR/READFIELD sequence as many times as necessary.)

Reading data, from part or all of the screen:

ATTRLIST

Return the locations of the attribute characters.

READSCREEN

Read data from part or all of the screen.

Writing data, into one field at a time:

WRITEFIELD

Write data into an unprotected field.

Writing data, into several fields at a time:

SCREENATTR

Update the cursor (row/column) variables again.

STREAM3270

Write data into several fields at one time.

TRAN3270

Send a data screen to the host system.

Receiving another screen of data from the host:

RECV3270

Accept a new data screen from the host.

SCREENATTR

Determine the number of fields in the screen and update the cursor variables containing the coordinates of the cursor position.

FIELDATTR

Determine the attributes of the fields specified.

Closing a session with the host:

CLOSE3270

Disassociate your terminal from an SSCP-LU session.

Terminal Transmits Data First

If you expect to send data to the host system first, use the intrinsics in a sequence like this:

Sending data to the host first:

OPEN3270

Establish communications with the host.

RECV3270

Accept the SNA IMF banner message.

TRAN3270

Send the [SYS REQ] key, which puts you into the LU-SSCP session and allows you to send data to the host.

RECV3270

Receive a blank SSCP-LU screen.

WRITEFIELD

Write to the LU-SSCP screen.

TRAN3270

Send the data screen to the host.

RECV3270

Accept a new screen of data from the host.

SCREENATTR

Determine the number of fields in the screen and update the variables containing the coordinates of the cursor position.

Reading data, from a specified field:

FIELDATTR

Determine the field attribute values for a specified field.

READFIELD

Read data from a specified field in the screen.

(Repeat the FIELDATTR/READFIELD sequence as many times as necessary.)

Reading data, from part or all of the screen:

ATTRLIST

Return the locations of the attribute characters.

READSCREEN

Read data from part or all of the screen.

Closing a session with the host:

CLOSE3270

End communications with the host.

NOTE: Be sure to log off from the host application you are using before you issue the CLOSE3270 intrinsic. The CLOSE3270 intrinsic terminates your session with the host system, but it does not terminate the host application. If you call CLOSE3270 before you log off from the host application, the host application is left running, and you have no way of terminating it, because your session has been closed.

For complete example programs, in non-transparent and transparent mode, see Appendix F “Sample Programs”

Feedback to webmaster