OpenTP1 Version 7 Tester and UAP Trace User's Guide
A logical message can contain one or more segments. A segment consists of a header part containing the segment information and a data part which is the message text.
There are five types of segments:
- Single segment
Segment in a logical message consisting of one segment only
- First segment
First segment in a logical message consisting of multiple segments
- Middle segment
One of the middle segments in a logical message consisting of multiple segments
- Last segment
Last segment in a logical message consisting of multiple segments
- Header segment
Segment prefixed to two concatenated messages
Specify the segment type in the header part.
- Organization of this subsection
- (1) Asynchronous receive message file
- (2) Synchronous receive message file
An asynchronous receive message file stores the messages received by the UAP in an MCF function (dc_mcf_receive function). Create one logical message per file. When a header segment is used, the data is prefixed to the message.
(a) File structure
Logical message consisting of one segment only
Logical message consisting of multiple segments
Header segment
(b) File contents
Item |
Position |
Length (bytes) |
Contents |
Header |
Input/output logical terminal name |
0 |
9 |
Logical terminal name (including final null character) to be passed to MCF functions. Specify the same name for each segment of a multiple-segment message. |
Map name |
9 |
9 |
Map name (including final null character). Specify the same name for each segment of a multiple-segment message.
This specification is valid only for functions that return a map name. |
Reserved |
18 |
9 |
Null character |
Segment type |
27 |
1 |
One of the following characters:
- F
- First segment
- M
- Middle segment
- L
- Last segment
- O
- Single segment
- H
- Header segment
|
Message length |
28 |
4 |
Message length (0-2147483647) |
Data |
Message |
32 |
n |
The data in the segment, of the specified message length |
- The following shows how the items in an asynchronous receive message file are related to message receive requests from a UAP via an MCF function.
- By concatenating header segments, data created in another file can be combined with the first or single segment and passed together to the UAP. The following shows how a header segment is related to a message receive request from a UAP by an MCF function.
- Segment types F (first segment) and M (middle segment) are handled in the same way. Also, segment types L (last segment) and O (single segment) are handled in the same way. For example, a file consisting of the three segment types F, M, and L is handled in the same way as a file consisting of segment types M, M, and O.
- The following shows the relationships between the segment type specified in the segment header for message send/receive with an MHP and the file type at execution. If the segment type is incorrectly specified, the receive request function returns an error at the first message receive.
Asynchronous receive message file containing segments other than header segments
When segment type L or O is specified for a message, the MHP regards the message as completed and ignores any subsequent segments.
Segment type |
Segments received by MHP |
First segment |
Middle segment |
Last segment |
F |
M |
L |
F, M, L |
F |
L |
X |
F, L#1 |
L |
X |
X |
L#2 |
X |
M |
L |
No segments received.#3 |
F |
X |
L |
- Legend:
- X: Specification other than F, M, L, or O.
- #1: At the third receive request, the MHP assumes that one logical message has been received and an error code is returned.
- #2: The middle and subsequent segments are ignored.
- #3: A message reports that the segment type is invalid and the receive request function returns an error code.
Asynchronous receive message file containing a header segment
Only the first segments in the file are valid.
Segment type |
Segments received by MHP |
H |
H#1 |
H + X |
X |
No segments received.#2 |
X + H |
- Legend:
- X: Specification other than H.
- #1: However, the segment is passed in concatenated format with F, M, L, or O.
- #2: A message reports that the segment type is invalid and the receive request function returns an error code.
A synchronous receive message file stores the synchronous messages received by the UAP via MCF functions (dc_mcf_recvsync and dc_mcf_sendrecv functions). A single file can contain a number of logical messages. When a header segment is used, the data is prefixed to the message.
(a) File structure
Logical message consisting of one segment only
Logical message consisting of multiple segments
Header segment
(b) File contents
Item |
Position |
Length (bytes) |
Contents |
Header |
Input/output logical terminal name |
0 |
9 |
Logical terminal name (including final null character) to be passed to MCF functions. Specify the same name for each segment of a multiple-segment logical message. |
Map name |
9 |
9 |
Map name (including final null character). Specify the same name for each segment of a multiple-segment message.
This specification is valid only for functions that return a map name. |
Reserved |
18 |
9 |
Null character |
Segment type |
27 |
1 |
One of the following characters:
- F
- First segment
- M
- Middle segment
- L
- Last segment
- O
- Single segment
- H
- Header segment
|
Message length |
28 |
4 |
Message length (0-2147483647) |
Data |
Message |
32 |
n |
The data in the segment, of the specified message length |
- The following shows how the items in a synchronous receive message file are related to message receive requests from a UAP by an MCF function.
- By concatenating header segments, data created in another file can be combined with the first or single segment and passed together to the UAP. The following shows how a header segment is related to a message receive request from a UAP by an MCF function.
- When the MCF simulator is used and the UAP receives a number of logical messages synchronously, associate the header segment prefixed to each receive message with the appropriate logical message. If no header segment is required for any of the logical messages, set a dummy header segment, specifying 0 as the message length. If none of the logical messages require a header segment, there is no need to create a header segment file.
The following shows the relationships between the header segment and the message receive requests from the UAP via MCF functions.
- Segment types F (first segment) and M (middle segment) are handled in the same way. Also, segment types L (last segment) and O (single segment) are handled in the same way. For example, a file consisting of the three segment types F, M, and L is handled in the same way as a file consisting of segment types M, M, and O.
- The following shows the relationships between the segment types specified in the segment headers for message send/receive with an MHP and the file types at execution. If a segment type is incorrectly specified, the receive request function returns an error at the first message receive.
Synchronous receive message file containing segments other than header segments
When segment type L or O is specified for a message, the MHP regards the message as completed and ignores any subsequent segments.
Segment type |
Segments received by MHP |
First segment |
Middle segment |
Last segment |
F |
M |
L |
(F, M, L) |
M |
M |
L |
(M, M, L) |
O |
O |
O |
(O), (O), (O) |
F |
L |
M |
(F, L), (M) |
X |
M |
L |
No segments received.# |
F |
X |
L |
- Legend:
- X: Specification other than F, M, L, or O.
- ( ): One logical message
- #: A message reports that the segment type is invalid and the receive request function returns an error code.
Synchronous receive message file containing a header segment
All the header segments in the file are valid.
Segment type |
Segments received by MHP |
H |
H#1 |
H + H |
H, H#1 |
H + X |
No segments received.#2 |
X |
X + H |
- Legend:
- X: Specification other than H.
- #1: However, the segment is passed in concatenated format with F, M, L, or O.
- #2: A message reports that the segment type is invalid and the receive request function returns an error code.
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.