Page 4.7
HIGH DENSITY RELAY MODULES 40-145/146/148
pickering
SECTION 4 - PROGRAMMING GUIDE
PROGRAMMING THE MODULE
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/C1 relay
pi40iv_Disconnect(vi, com1, ch1); // Releases the A1/C1 relay
pi40iv_Connect(vi, com6, ch6);
// Operates the A6/C6 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/C1 relay
pipx40_setChannelState(vi, sub_unit, 1, VI_OFF);
// Releases the A1/C1 relay
pipx40_setChannelState(vi, sub_unit, 6, VI_ON);
// Operates the A6/C6 relay
setChannelPattern
// Sub-unit is 50 bits wide, so 2 ViUInt32 values are needed to hold the entire pattern
ViUInt32 data[2];
data[0] = 1;
// Sets lowest bit to 1, A1/C1 relay
data[1] = 0;
pipx40_setChannelPattern( vi, sub_unit, data);
data[0] = 0x20;
// Sets 6th bit, A6/C6 relay
data[1] = 0;
// All other relays are set to off
pipx40_setChannelPattern( vi, sub_unit, data);
Here are examples of using the drivers with the 40-145-001 (50 x SPST) module. All other versions in the series
operate in the same way but with different numbers of bits in the sub-unit.
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/C1 relay
PIL_OpBit( card_num, sub_unit, 1, 0); // Releases the A1/C1 relay
PIL_OpBit( card_num, sub_unit, 6, 1); // Operates the A6/C6 relay
WriteSub
// Sub-unit is 50 bits wide, so 2 DWORDs are needed to hold the pattern
DWORD data[2];
data[0] = 1;
// Sets lowest bit to 1, A1/C1 relay
data[1] = 0;
PIL_WriteSub( card_num, sub_unit, data);
data[0] = 0x20;
// Sets 6th bit, A6/C6 relay
data[1] = 0;
// All other relays are set to off
PIL_WriteSub( card_num, sub_unit, data);
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com