Programming The Module - Pickering PXI 40-145 User Manual

High density spst, dpst & spdt relay modules
Table of Contents

Advertisement

pickering

PROGRAMMING THE MODULE

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);
PIL_OpBit( card_num, sub_unit, 1, 0);
PIL_OpBit( card_num, sub_unit, 6, 1);
WriteSub
// Sub-unit is 50 bits wide, so 2 DWORDs are needed to hold the pattern
DWORD data[2];
data[0] = 1;
data[1] = 0;
PIL_WriteSub( card_num, sub_unit, data);
data[0] = 0x20;
data[1] = 0;
PIL_WriteSub( card_num, sub_unit, data);
Using PIPX40
setChannelState
ViUInt32 sub_unit = 1;
pipx40_setChannelState(vi, sub_unit, 1, VI_ON);
pipx40_setChannelState(vi, sub_unit, 1, VI_OFF);
pipx40_setChannelState(vi, sub_unit, 6, VI_ON);
setChannelPattern
// Sub-unit is 50 bits wide, so 2 ViUInt32 values are needed to hold the entire pattern
ViUInt32 data[2];
data[0] = 1;
data[1] = 0;
pipx40_setChannelPattern( vi, sub_unit, data);
data[0] = 0x20;
data[1] = 0;
pipx40_setChannelPattern( vi, sub_unit, data);
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);
pi40iv_Disconnect(vi, com1, ch1);
pi40iv_Connect(vi, com6, ch6);
The IVI Swtch driver specification contains no bulk setting capabilities.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
// Sets lowest bit to 1, A1/C1 relay
// Sets 6th bit, A6/C6 relay
// All other relays are set to off
// Sets lowest bit to 1, A1/C1 relay
// Sets 6th bit, A6/C6 relay
// All other relays are set to off
// Operates the A1/C1 relay
// Releases the A1/C1 relay
// Operates the A6/C6 relay
HIGH DENSITY RELAY MODULES 40-145/146/148
SECTION 4 - PROGRAMMING GUIDE
// Operates the A1/C1 relay
// Releases the A1/C1 relay
// Operates the A6/C6 relay
// Operates the A1/C1 relay
// Releases the A1/C1 relay
// Operates the A6/C6 relay
Page 4.7

Advertisement

Table of Contents
loading

Table of Contents