X25AM Programming Manual

PTP Applications
X25AM Programming Manual527201-001
3-52
Wait for the Data Exchange (Use Mode 1)
Wait for the Data Exchange (Use Mode 1)
The program waits for the call with a CONTROL 11. It waits for the data exchange by
reading data for a packet. READ and WRITE can be in any order, depending on the
program logic and the response expected from the remote device. The program ends
the call with a CONTROL 12.
1. OPEN the subdevice.
!
!Nothing is sent or received.
2. SETMODE 31,1,0.
!
!Set the data-exchange mode to 1.
3. CONTROL 11.
!
!Wait for an Incoming Call.
!
!An Incoming Call is received.
!A Call Accepted is sent.
!CONTROL 11 completes.
!
!The remote device writes the data for the first packet for
!logical record A. The WRITE COUNT is equal to PACKETSIZE.
!The M bit is set to one.
!
!The first data packet (M=1) for logical record A is
!received.
4. READ data from a packet.
!
!The program waits for data from the remote device with a
!READ. The remote device has already sent the first
!packet for logical record A. The data from the data
!packet is transferred to the READ buffer.
!The READ completes successfully.
!
!The remote device writes the second and last packet for
!logical record A. The data is less than PACKETSIZE.
!The M bit is set to 0.
!
!The final data packet (M=0) for logical record A is
!received.