beautypg.com

Queueing a block transfer – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual

Page 94

background image

Chapter 8

Block Transfer

8-4

Invalid pointers: Conforming to established C coding conventions,

library routines that need access to user packets take pointers as their
function arguments. There is no way for a called function to check
whether your program has sent it a valid pointer. Therefore, the
programmer is solely responsible for sending valid pointers to the
library routines. If the pointer arguments don’t point to proper packets,
the program performs incorrectly or crashes, possibly locking up the
host computer.

To start a BT, you store the needed fields (length of data, plus the actual
data for a write BT) in the packet and then call the bt_que routine. If you
prefer, you can use bt_read and bt_write. Those macros compile into
calls on bt_que but let you omit one function argument from your
program.

Once the request has been queued, your program must check periodically
to see whether the request has finished; see ”Polling for Completion” in
this chapter.

Queueing a Block Transfer