Page 4.6
PROGRAMMABLE RESISTOR MODULES 40-290/291
pickering
SECTION 4 - PROGRAMMING GUIDE
Using pi40iv
The IVI driver has no special labelling for this card and treats the array of switches as a simple array, labelling the
channels using the normal com./ch labelling tags.
pi40iv_Connect(vi, com1, ch1);
// Operates the A1.1/C1.1 relay
pi40iv_Disconnect(vi, com1, ch1); // Releases the A1.1/C1.1 relay
pi40iv_Connect(vi, com6, ch6);
// Operates the A6.1/C6.1 relay
The IVI Swtch driver specification contains no bulk setting capabilities.
Using PIPX40
setChannelState
ViUInt32 sub_unit = 1;
pipx40_setChannelState(vi, sub_unit, 1, VI_ON);
// Operates the A1.1/C1.1 relay
pipx40_setChannelState(vi, sub_unit, 1, VI_OFF);
// Releases the A1.1/C1.1 relay
pipx40_setChannelState(vi, sub_unit, 6, VI_ON);
// Operates the A6.1/C6.1 relay
setChannelPattern
// Sub-unit is 32 bits wide, so 1 ViUInt32 value is needed to hold the entire pattern
ViUInt32 data[1];
data[0] = 1;
// Sets lowest bit to 1, A1.1/C1.1 relay
pipx40_setChannelPattern( vi, sub_unit, data);
data[0] = 0x20;
// Sets 6th bit, A6.1/C6.1 relay
// All other relays are set to off
pipx40_setChannelPattern( vi, sub_unit, data);
writeCalibration and readCalibration
These functions can be used to Write and Read calibration data.
PROGRAMMING THE MODULE
Here are examples of using the drivers with the 40-290-021 (32 x SPST) module. For further information please
refer to the help information supplied with the software.
Using PILPXI
To operate a relay the user could use the simple OpBit command or the WriteSub commands
OpBit
DWORD sub_unit = 1;
PIL_OpBit( card_num, sub_unit, 1, 1); // Operates the A1.1/C1.1 relay
PIL_OpBit( card_num, sub_unit, 1, 0); // Releases the A1.1/C1.1 relay
PIL_OpBit( card_num, sub_unit, 6, 1); // Operates the A6.1/C6.1 relay
WriteSub
// Sub-unit is 32 bits wide, so 1 DWORD is needed to hold the pattern
DWORD data[1];
data[0] = 1;
// Sets lowest bit to 1, A1.1/C1.1 relay
PIL_WriteSub( card_num, sub_unit, data);
data[0] = 0x20;
// Sets 6th bit, A6.1/C6.1 relay
// All other relays are set to off
PIL_WriteSub( card_num, sub_unit, data);
WriteCal and ReadCal
These functions can be used to Write and Read calibration data.