Page 4.9
8/16 TRIBUTARY DAISY CHAIN SWITCH, BALANCED 40-795/796
pickering
SECTION 4 - PROGRAMMING GUIDE
Using pi40iv
The IVI driver labels this card in a similar manner to the Sub-units of the tables above using the normal comA/chA
(etc) labelling tags.
pi40iv_Connect(vi, comA, chA1);
// Selects RL1 and RL2
pi40iv_Disconnect(vi, comA, chA1); // Releases RL1 and RL2
pi40iv_Connect(vi, comA, chA6);
// Selects RL31 and RL32
Using PIPX40
setChannelState
ViUInt32 sub_unit = 1;
pipx40_setChannelState(vi, sub_unit, 1, VI_ON);
// Selects RL1 and RL2
pipx40_setChannelState(vi, sub_unit, 1, VI_OFF);
// Releases RL1 and RL2
pipx40_setChannelState(vi, sub_unit, 6, VI_ON);
// Selects RL31 and RL32
setChannelPattern
// Sub-unit 1 is 8 bits wide, so 1 ViUInt32 value is needed to hold the entire pattern
ViUInt32 data[1];
data[0] = 1;
// Sets lowest bit to 1, Selects RL1 and Rl2
pipx40_setChannelPattern( vi, sub_unit, data);
data[0] = 0x20;
// Sets 6th bit, Selects RL31 and Rl32
// All other relays are set to off
pipx40_setChannelPattern( vi, sub_unit, data);
PROGRAMMING THE MODULE 40-795/796
Here are some simple examples of using the drivers with the Daisy Chain section of the 40-795 module.
Using the drivers with the 40-796 module is similar.
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); // Selects RL1 and RL2
PIL_OpBit( card_num, sub_unit, 1, 0); // Releases RL1 and RL2
PIL_OpBit( card_num, sub_unit, 6, 1); // Selects RL31 and RL32
WriteSub-
// Sub-unit 1 is 8 bits wide, so 1 DWORD is needed to hold the pattern
DWORD data[1];
data[0] = 1;
// Sets lowest bit to 1, Selects RL1 and RL2
PIL_WriteSub( card_num, sub_unit, data);
data[0] = 0x20;
// Sets 6th bit, Selects RL31 and RL32
// All other relays are set to off
PIL_WriteSub( card_num, sub_unit, data);
The IVI Swtch driver specification contains no bulk setting capabilities.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com