X25AM Programming Manual

PTP Applications
X25AM Programming Manual527201-001
3-59
Wait for the Data Exchange (Use Mode 3)
Wait for the Data Exchange (Use Mode 3)
The program waits for the call with a CONTROL 11. It waits for the data exchange by
reading data for a data block. After the initial READ, READs and WRITEs can be in
any order, depending on the program logic and the response expected from the remote
device. This example also shows P(R) and P(S) to demonstrate packet sequencing.
In the following example, L3WINDOW is 2.
1. OPEN the subdevice.
!
!Nothing is sent or received.
2. SETMODE 31,3,0.
!
!Set the data-exchange mode to 3.
3. CONTROL 11.
!
!Wait for an Incoming Call.
!An Incoming Call is received.
!A Call Accepted is sent.
!
!The remote device writes a large block of data that
!is also a logical record.
!The first through the last data packets are received.
!The M bit is set to 0 in the last packet and to 1 in
!all other packets.
4. READ data.
!
!The program waits for data from the remote device with a
!READ. The remote device has already sent all of the
!packets. The data (M=0) is transferred to the READ buffer.
!The READ completes successfully.
!
!An interrupt packet is received.
5. READ data.
!
!The program waits for data from the remote device with a
!READ. An interrupt packet has been received. Data from
!the interrupt packet is transferred to the READ buffer.
!Bit 13 in the MCW is set to one.
!The READ completes successfully.
!An Interrupt Confirmation packet is sent.