Technical data
Publication No. 980824-118 Rev. A 1260-118/-118A User Manual
Astronics Test Systems Module Operation 3-7
ViUInt8 creg_val;
ViBusAddress creg0_addr;
ViBusAddress creg1_addr;
ViBusAddress creg2_addr;
ViSession hdl1260; /* VISA handle to the 1260-01T */
ViSession hdlRM; /* VISA handle to the resource manager */
ViStatus error; /* VISA error code */
/* open the resource manager */
/* this must be done once in application program */
error = viOpenDefaultRM (&hdlRM);
if (error < 0) {
/* error handling code goes here */
}
/* get a handle for the 1260-01T */
error = viOpen (hdlRM, RI1260_01_DESC, VI_NULL,VI_NULL, &hdl1260);
if (error < 0) {
/* error handling code goes here */
}
/* form the offset for control register 0 */
/* note that the base A24 Address for the 1260-01T */
/* is already accounted for by VISA calls viIn8() and */
/* viOut8() */
/* module address shifted 10 places = module address x 1024 */
creg0_addr = (MOD_ADDR_118 << 10) + 1;
creg1_addr = creg0_addr + 2;
creg2_addr = creg1_addr + 2;
/* close relays 14 without affecting the state of */
/* relays 9, 10, 11, 12, 13, 15, and 16 */
error = viIn8 (hdl1260, VI_A24_SPACE, creg1_addr, &creg_val);
if (error < 0) {
/* error handling code goes here */
}
/* invert the bits to get the present control register value */
creg_val = ~creg_val;
/* AND to leave every relay except 14 unchanged */