1260-134 User Manual
Module Operation 3-10
Racal Instruments
Ó
2003
/* is already accounted for by VISA calls viIn8() and */
/* viOut8() */
/* module address shifted 10 places = module address x 1024 */
creg0_addr = (MOD_ADDR_134 << 10) + 1;
creg1_addr = creg 2;
creg2_addr = creg 2;
/* close channel 123 without affecting the state of */
/* channels 122, 141, 151, 152, and 153 */
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 channel except 123 unchanged */
creg_val &= ~ (0x20);
/* OR in the bit to close channel 123 */
creg_val |= 0x20;
/* write the updated control register value */
error = viOut8 (hdl1260, VI_A24_SPACE, creg1_addr, creg_val);
if (error < 0) {
/* error handling code goes here */
}
/* open channel 93 without affecting channels 100, 101, 120, 121,
and 113 */
error = viIn8 (hdl1260, VI_A24_SPACE, creg2_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 channel except 93 unchanged */
/* leave bit 0 clear to open channel 93 */
creg_val &= ~ (0x01);
/* write the updated control register value */
error = viOut8 (hdl1260, VI_A24_SPACE, creg2_addr, creg_val);
if (error < 0) {