Page 4.4
8 TRIBUTARY 75Ω DAISY CHAIN SWITCH 40-792
pickering
SECTION 4 - PROGRAMMING GUIDE
Using pi40iv
The IVI driver labels this card in a similar manner to the Sub-units of the table above using the normal comA/chA
(etc) labelling tags.
pi40iv_Connect(vi, comA, chA1);
// Selects Tributary 1
pi40iv_Disconnect(vi, comA, chA1); // Releases Tributary 1
pi40iv_Connect(vi, comA, chA6);
// Selects Tributary 6
Using PIPX40
setChannelState
ViUInt32 sub_unit = 1;
pipx40_setChannelState(vi, sub_unit, 1, VI_ON);
// Selects Tributary 1
pipx40_setChannelState(vi, sub_unit, 1, VI_OFF);
// Releases Tributary 1
pipx40_setChannelState(vi, sub_unit, 6, VI_ON);
// Selects Tributary 6
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 Tributary 1
pipx40_setChannelPattern( vi, sub_unit, data);
data[0] = 0x20;
// Sets 6th bit, Selects Tributary 6
// All other relays are set to off
pipx40_setChannelPattern( vi, sub_unit, data);
PROGRAMMING THE MODULE 40-792
Here are some simple examples of using the drivers with the 40-792 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); // Selects Tributary 1
PIL_OpBit( card_num, sub_unit, 1, 0); // Releases Tributary 1
PIL_OpBit( card_num, sub_unit, 6, 1); // Selects Tributary 6
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 Tributary 1
PIL_WriteSub( card_num, sub_unit, data);
data[0] = 0x20;
// Sets 6th bit, Selects Tributary 6
// All other relays are set to off
PIL_WriteSub( card_num, sub_unit, data);
Note: comB is equivalent to Sub-unit 2, and com3 to Sub-unit 3.
The IVI Swtch driver specification contains no bulk setting capabilities.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com