Appendix C
Sample Programs
© National Instruments Corporation
C-9
GPIB-1014 User Manual
|
|
* * * * * * * * * * * * * * *
| * RECEIVE - RCV
*
|
* * * * * * * * * * * * * * *
|
| Summary:
|
- Called by READ to receive data if GPIB-1014 is
| Controller-In-Charge
| - Called directly from main program to receive data if
|
GPIB-1014 is Idle Controller
|
| Assumptions on entry:
| - GPIB-1014 is Standby or Idle Controller
|
- GPIB-1014 is or will be addressed to listen
| - The GPIB Talker has been or will be addressed
| - The Talker will send END with last byte if the number
|
of bytes sent is less than the byte count
| - The d0 register contains the byte count
| - The a0 register contains the address of the data
|
buffer
| - The user-specified variable cic is set properly
|
| Actions:
| - Clear DMAC channel 0 and 1 status registers
| - Configure channel 0 to transfer all but the last byte
| - Configure channel 1 for carry cycle to implement
|
handshake holdoff after last byte
|
- Start the DMA channels
| - Release any holdoff in progress
|
- Set IMR2 to enable DMAs
|
- Wait for DMA done or GPIB END message
|
- Disable DMA
| - Set d0 register to number of bytes received
|
| Status on return:
|
- a NRFD handshake holdoff is in effect
|
- The number of bytes transferred is in d0