X25AM Programming Manual

PTP Applications
X25AM Programming Manual527201-001
3-43
Programming Examples Using a Permanent Virtual
Circuit
WRITE
WRITEREAD
Programming Examples Using a Permanent
Virtual Circuit
These examples are written in a coding shorthand (also called generic or “pseudo-
code). They are designed to help you understand the most important aspects of data
exchange with a PVC.
When a PVC is used, calls are not set up or disconnected. Therefore, only the data
transfer phase must be included in your application.
In the following examples, L3WINDOW is 2.
Start the Data Exchange (Use Mode 0)
The program starts the data exchange, which requires writing a logical record. READs
and WRITEs can be in any order, depending on the program logic and the response
expected from the remote device.
1. OPEN the subdevice.
!
!Nothing is sent or returned.
2. WRITE logical record A.
!
!The WRITE has a WRITE COUNT that is less than PACKETSIZE.
!The logical record will fit into one packet.
!
!The data packet (M=0) for logical record A is sent.
!The WRITE completes successfully.
3. WRITE logical record B.
!
!The WRITE has a WRITE COUNT that is less than PACKETSIZE.
!The logical record will fit into one packet.
CALL SETPARAM (filenum, buffer, write^count,
count^written, nowait^tag)
CALL SETPARAM (filenum, buffer, write^count,
read^count, count^read, nowait^tag)
Note. These examples are written in a generic, or “pseudo-” code. Following this section is a
sample PTP application written in TAL.