PUT PIO(3)

NAME
PUT_PIO, PUT_DAC, PUT_SLU, PUT_PENDANT_MSG, SET_PIO, CLEAR_PIO, -- RCI CHG macros for setting robot controller output signals.

USAGE
#include <rci.h>

PUT_PIO(rbt, num, val)
   RCI_RBT *rbt;
   int num;
   unsigned long val;

PUT_DAC(rbt, num, val)
   RCI_RBT *rbt;
   int num;
   int val;

PUT_SLU(rbt, num, buffer, size)
   RCI_RBT *rbt;
   int num, size;
   char *buffer;

PUT_PENDANT_MSG(rbt, buffer, size)
   RCI_RBT *rbt;
   char *buffer;
   int size;

SET_PIO(rbt, num, mask)
   RCI_RBT *rbt;
   int num;
   unsigned long mask;

CLEAR_PIO(rbt, num, mask)
   RCI_RBT *rbt;
   int num;
   unsigned long mask;

ARGUMENTS

rbt --
    Pointer to RCI robot structure.

num --
    Channel or unit number.

val --
    Output value.

buffer --
    Byte packet buffer.

size --
    Size of byte packet buffer.

DESCRIPTION
These macros control the robot controller output signals. Not all of these outputs may be available; information describing which features are available is read into the HOW structure at the start of each control session. The macros may be called from any part of an RCI program.

PUT_PIO() sets the value of the parallel port num to val. Each parallel port is described by the type unsigned short, which is 16 bits long on VAX or SUN systems. The number of available parallel output ports is given in the numPioOut field of the HOW structure. The set value is read back into the pioOutput field.

PUT_DAC() sets the value of the DAC channel num to val. The number of available DAC channels is given in the numDac field of the HOW structure. The set value is recorded in the dacOutput field. Values which lie beyond the DAC range (for instance, many DACs are only 12 bits long) are clipped, although the recorded value in the HOW structure does not necessarily reflect this clipping.

PUT_SLU() sends the given byte buffer to the indicated serial line unit. The entire buffer is transferred to the robot controller during the next cycle, and its size will be truncated to MAX_SLUBUF. The number of available SLUs is given in the numSlu field of the HOW structure. There is no facility (at present) for reading back the status of the transmitted information.

PUT_PENDANT_MSG() outputs the given byte buffer to the robot teach pendant. A teach pendant is available if PENDANT_AVAIL is set in the options field of the HOW structure. The entire buffer is transferred to the robot controller during the next cycle, and its size will be truncated to MAX_SLUBUF. The dispatched pendant message is recorded in the pendantMsg field of the HOW structure.

NOTE: Because PUT_SLU() and PUT_PENDANT_MSG() are implemented as macros, it is very important to make sure the buffer pointer buffer is either a char*, or is cast to a char*.

SET_PIO() sets individual bits (specified by mask) in the parallel port num. The final set value is read back into the pioOutput field of the HOW structure.

CLEAR_PIO() clears individual bits (specified by mask) in the parallel port num. The final set value is read back into the pioOutput field of the HOW structure.

DIAGNOSTICS
Failures will result in an abort condition. Defined abort codes include:

ETooMany --
    Too much information to write to the robot controller in one burst. This is a possibility if a lot information is being transferred to the serial line units.

SEE ALSO
CHG(3), HOW(3).