The C interface to the vision library consists of four routines: VisionOpen, VisionClose, VisionGetErr, and VisionGetObj. Interaction with the vision server is accomplished by first opening a connection to with VisionOpen, then using VisionGetObj to request data from the vision server and finally, when finished, closing the connection to the vision server with VisionClose. The vision routines use port identifiers to maintain connections to the vision server. By using this system a single C program would be able to make connections to multiple vision servers or to make multiple connections to a single vision server. Each time a connection to a vision server is opened with the VisionOpen command it should later be closed with the VisionClose command. int VisionOpen(char *Addr) Open a connection to a vision server on the machine with the specified IP address. Addr is a character string of the IP address of a machine that is running a vision server. On success, a valid file descriptor is returned. This file descriptor should be used for all future access to the vision server. On failure -1 is returned and VisionGetErr should be used to retrieve an error message. void VisionClose(int fd) Close a connection to the vision server. fd is the descriptor returned by a successful call to VisionOpen. int VisionGetObj( int fd, // File Descriptor to use char *ObjId, // The ID of the object to retrieve from the vision server unsigned *x, // x coordinate 1 (Center for circle) unsigned *y, // y coordinate 1 (Center for circle) unsigned *x2, // Width unsigned *y2 // Height ) Get information about a specific object currently defined on the vision server. fd is a descriptor returned by a successful call to VisionOpen. ObjId is the character Id of the object for which information is being requested. The object must be defined on the vision server and should either be a Circle, a Rectangle, or a Line.. x, y, x2, and y2 are pointers to variables to store information from the vision server. The meaning of each is dependent on the particular type of object for which information is being requested: x y x2 y2 Rectangle x coord of corner y coord of corner width height Circle x coord of center y coord of center radius radius Line x coord of start y coord of start x coord of end y coord of end A return value of 0 indicates success and a return value of -1 indicates an error. char *VisionGetErr() Get a text message indicating the last error from the vision server. VisionGetErr should be used immediately after an error to retrieve an error message and should be ignored otherwise.