Index

setdio board, set|clear|assign, mask

Change the value of the output register of a given digital I/O board.

Arguments:
DioBoard reg
The name of the digital I/O board.
BitMaskOper operator
The way to combine the template value with the current value of the output register.
BitMask mask
The template bit-mask to be combined with the current value of the output register.

Example 1:
The following example sets the states of outputs 0 and 3 of the noise generator digital I/O board to high resistance, without changing the states of the other outputs.
  setdio ngen, set, b0 + b3
Example 2:
The following example clears the states of outputs 0 and 3 of the noise generator digital I/O board to low resistance, without changing the states of the other outputs.
  setdio ngen, clear, b0 + b3
Example 3:
All of the following examples set all outputs of the noise generator output to states corresponding to the bits of a 32 bit integer. Bits that are set to 1 correspond to high resistance outputs. Bits that are set to 0 correspond to low resistance outputs. In the first case the high resistance bits are specified as a set of bit names. In the second case they are specified as a binary number, in the third as a hexadecimal number, and in the final case, as a decimal number.
  setdio ngen, assign, b0 + b3 + b5
  setdio ngen, assign, 0b101001
  setdio ngen, assign, 0x29
  setdio ngen, assign, 41
Context:
The outputs of the National Instruments digital I/O boards that are being used by the CBI are error-prone to set via the setreg command. The 32 opto-isolator outputs are mapped in a big-endian fashion to the 4 bytes of the output register, such that bit 0 corresponds to bit 0 of output[3] and bit 8 corresponds to bit 0 of output[2]. This would be sufficiently confusing on its own if one didn't also have to contend with the fact that to set a given output to logical high (high resistance), one has to set the corresponding bit to low. The setdio command is an attempt to provide a more convenient way to set the outputs.

Martin Shepherd (12-Jan-1999)