Racal Instruments 1260-82 User Manual page 31

1260 vxi switching card, vxi optical switch
Table of Contents

Advertisement

1260-82 User Manual
/*
* CLOSE CHANNEL 2, OPEN ALL OTHER CHANNELS
* Use "ctrl_val" as the RAM image to control all channels
*/
ctrl_val = 0x04;
/* write the control register */
error = viOut8 (hdl1260, VI_A24_SPACE, control_reg, ctrl_val);
if (error < 0) {
/* error handling code goes here */
}
/* now close channel 0 */
ctrl_val |= 0x01;
error = viOut8 (hdl1260, VI_A24_SPACE, control_reg, ctrl_val);
if (error < 0) {
/* error handling code goes here */
}
/* wait 16 milliseconds to allow relays to settle */
/* before chacking actual position */
/* this is a fictional delay routine; system-dependent */
msec_delay( 16 );
/* read the relay status register */
error = viIn8 (hdl1260, VI_A24_SPACE, control_reg, &position);
if (error < 0) {
/* error handling code goes here */
}
Position =
/* invert bits on read-back*/
/* mask off the bits of interest (based on –82 model) */
/* masks are: */
/* 1260-82A:
/* 1260-82B:
/* 1260-82C:
/* 1260-82D:
/* 1260-82E:
/* 1260-82F:
/* this example is 1260-82C */
mask = 0x7;
if ((position & mask) != (ctrl_val & mask)) {
/* set the ERROR LED on */
error = viOut8 (hdl1260, VI_A24_SPACE, error_LED_reg, 0x08);
if (error < 0) {
}
position;
0x01 */
0x03 */
0x07 */
0x0F */
0x1F */
0x3F */
/* error handling code goes here */
Module Operation 3-11

Advertisement

Table of Contents
loading

Table of Contents