CP6100 I/O Process Programming Manual

Using CP6100: Programming
• OPEN gives the application access to the line. A line can be
dedicated to one application or shared with others, or the
same application can open the line more than once.
• CLOSE stops the connection between an application and the
line. (Other applications can still use the line.)
• SETMODE lets requests from the application to the line be
completed in any order.
• CANCEL cancels the oldest request pending for the line.
Requests in the second category may result in action on the line
itself: for example, they transfer data or line control
information, retrieve statistics or configuration data. The
calls and their functions are as follows:
• WRITEREAD conveys a request from the application to the
protocol task, and returns a reply from the protocol task to
the application. At the time of the call, the WRITEREAD
buffer includes a description of the requested function, a
request ID unique among all pending requests for the line, and
any data to be transmitted. When the call completes, the
buffer includes request status and data read from the line.
Figure 2-2 illustrates the structure of the WRITEREAD buffer.
If a WRITEREAD call completes and the buffer shows good
request status, the application request was completely
satisfied. For example, if you're using ADCCP and a
"SENDTEXT" request completes, transmitted frames have been
acknowledged by their destination device.
Notice that WRITEREAD is used for line control, as well as for
data transfers. A function you'd perform with SETMODE or
CONTROL if you were using another communication product, you
perform with WRITEREAD in this case.
The list of functions you perform with WRITEREAD varies with
the protocol; so does the list of errors that can be reported
in the status field. The following functions apply to all
protocols, with some differences in implementation:
Function
Code Function
1 Set Configuration Parameters
2 Fetch Configuration Parameters
3 Start Protocol Trace
4 Stop Protocol Trace
5 Fetch Statistics
6 Start Line Operation
7 Stop Line Operation
2-5