Page 4.4
RF SWITCHING MODULE 40-710
pickering
SECTION 4 - PROGRAMMING GUIDE
Using pi40iv
The IVI driver labels the channels using the normal com/nc1 or com/no1 (etc) labelling tags.
pi40iv_Connect(vi, com1, no1);
// Connects Ch1 to its relays NO position.
pi40iv_Disconnect(vi, com1, nc1); // Returns the Ch1 relay to its NC position.
pi40iv_Connect(vi, com3, no3);
// Connects Ch3 to its relays NO position.
The IVI Switch driver specification contains no bulk setting capabilities.
Using PIPX40
setChannelState
ViUInt32 sub_unit = 1;
pipx40_setChannelState(vi, sub_unit, 1, VI_ON);
// Operates the Ch1 relay
pipx40_setChannelState(vi, sub_unit, 1, VI_OFF);
// Releases the Ch1 relay
pipx40_setChannelState(vi, sub_unit, 3, VI_ON);
// Operates the Ch3 relay
setChannelPattern
// Sub-unit is 4 bits wide, so 1 ViUInt32 value is needed to hold the entire pattern
ViUInt32 data[1];
data[0] = 1;
// Sets lowest bit to 1, Ch1 relay
pipx40_setChannelPattern( vi, sub_unit, data);
data[0] = 0x4;
// Sets 3rd bit, Ch3 relay
// All other relays are set to off
pipx40_setChannelPattern( vi, sub_unit, data);
PROGRAMMING THE MODULE 40-710
Here are some examples of using the drivers with the 40-710 (4 x SPDT) module.
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 Ch1 relay
PIL_OpBit( card_num, sub_unit, 1, 0); // Releases the Ch1 relay
PIL_OpBit( card_num, sub_unit, 3, 1); // Operates the Ch3 relay
WriteSub
// Sub-unit is 4 bits wide, so 1 DWORD is needed to hold the pattern
DWORD data[1];
data[0] = 1;
// Sets lowest bit to 1, Ch1 relay
PIL_WriteSub( card_num, sub_unit, data);
data[0] = 0x4;
// Sets 3rd bit, Ch3 relay
// 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