Page 4.3
HIGH POWER RELAY MODULE 40-170
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/C1 relay
pi40iv_Disconnect(vi, com1, ch1); // Releases the A1/C1 relay
pi40iv_Connect(vi, com2, ch2);
// Operates the A2/C2 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, 2, VI_ON);
// Operates the A2/C2 relay
setChannelPattern
// Sub-unit is 2 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/C1 relay
pipx40_setChannelPattern( vi, sub_unit, data);
data[0] = 0x2;
// Sets 2nd bit, A2/C2 relay
// All other relays are set to off
pipx40_setChannelPattern( vi, sub_unit, data);
PROGRAMMING THE MODULE
Here are examples of using the drivers with the 40-170 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 A1/C1 relay
PIL_OpBit( card_num, sub_unit, 1, 0); // Releases the A1/C1 relay
PIL_OpBit( card_num, sub_unit, 2, 1); // Operates the A2/C2 relay
WriteSub
// Sub-unit is 2 bits wide, so 1 DWORD is needed to hold the pattern
DWORD data[1];
data[0] = 1;
// Sets lowest bit to 1, A1/C1 relay
PIL_WriteSub( card_num, sub_unit, data);
data[0] = 0x2;
// Sets 2nd bit, A2/C2 relay
// All other relays are set to off
PIL_WriteSub( card_num, sub_unit, data);
Содержание 40-170
Страница 2: ...pickeringtest com Issue 4 3 January 2020 40 170 User Manual PXI High Power Relay Module ...
Страница 7: ...Page VI HIGH POWER RELAY MODULE 40 170 pickering THIS PAGE INTENTIONALLY BLANK ...
Страница 21: ...Page 3 4 HIGH POWER RELAY MODULE 40 170 pickering SECTION 3 INSTALLATION THIS PAGE INTENTIONALLY BLANK ...
Страница 25: ...Page 4 4 HIGH POWER RELAY MODULE 40 170 pickering SECTION 4 PROGRAMMING GUIDE THIS PAGE INTENTIONALLY BLANK ...
Страница 29: ...HIGH POWER RELAY MODULE 40 170 Page 6 2 pickering SECTION 6 TROUBLE SHOOTING THIS PAGE INTENTIONALLY BLANK ...