Sensoray Smart A/D User Manual
Page 13

S
ENSORAY
I
NSTRUCTION
M
ANUAL
S
MART
A/D D
RIVER
FOR
W
INDOWS
Page 11
For example, models with eight channels use channel numbers ranging from 0 through 7. Models with sixteen channels use
channel numbers ranging from 0 through 15, etc.
3.7.1 SetFailMode()
Function:
Declares whether the specified channel’s output data value should default to a large positive value or to a large
negative value in the event an open sensor is detected.
Prototype:
void SetFailMode( long hBD, long channel, long failhigh );
Example:
///////////////////////////////////////////////////////////////////////////
// Program all channels on board number 5 to fail high.
///////////////////////////////////////////////////////////////////////////
#define NCHANS 16 // Assume this is a 16-channel Smart A/D board
for ( chan = 0; chan < NCHANS; chan++ )
SetFailMode( 5, chan, true );
3.7.2 SetFilter()
Function:
Applies a software low-pass filter to the specified channel. The filter is implemented by the Smart A/D™ board as
described in the Smart A/D™ hardware instruction manual.
Prototype:
void SetFilter( long hBD, long channel, long filtval );
Example:
///////////////////////////////////////////////////////////////////////////
// Program board number 5, channel 11, to have a 50% filter.
///////////////////////////////////////////////////////////////////////////
#define FILTER_PCT 50 // Desired filter percentage (0% to 99%).
SetFilter( 5, 11, FILTER_PCT * 2.56 );
Parameter
Type
Description
hBD
long
Board handle.
channel
long
Sensor channel number to be affected.
failhigh
long
0 = fail low (large negative value).
1 = fail high (large positive value ).
Parameter
Type
Description
hBD
long
Board handle.
channel
long
Sensor channel number to be affected.
filtval
long
Values may range from 0 (default, filter is disabled) to 255 (maximum filter).
Filter values outside the legal range may cause unexpected filtering results.