Set filter – Sensoray 417 User Manual
Page 16

15
Sensoray Model 417
Chapter
4
Programming
Set Filter
This command establishes a software single-pole low-pass filter for the specified channel. The
second command byte specifies unsigned filter factor,
F
, which may have any value from 0 to 255,
inclusive. The relationship between F and filter percentage,
P
, is:
All channel filter factors default to zero after a reset. This effectively disables the filters and maxi-
mizes channel response. A non-zero factor in electrically noisy environments may help to reduce
measurement noise.
Rather than computing the theoretical value of filter constants, we recommend that you experi-
ment with different values to find the best response/noise tradeoff. Some applications, however,
require knowledge of the filter time constant. This expression describes the relationship between
time constant t, expressed in seconds, and filter factor F:
COMMAND: (160 + Chan), (FilterFactor)
RESPONSE:
NONE
VB Code Example:
‘*********************************************************************
‘ Generic procedure to set filter factor on any channel.
‘*********************************************************************
Sub SetFilter(BasePort%, Channel%, FiltFactor%)
Const SET_FILT = 160
‘ SET FILTER CONSTANT command opcode
‘ Send command string to coprocessor board
Call SendByte(BasePort, SET_FILT + Channel)
Call SendByte(BasePort, FiltFactor)
End Sub
‘*********************************************************************
‘ Set up channel 4 with a 12.5% low-pass filter. To convert filter
‘ percentage (0 to 100%) to filter factor, multiply by 2.55.
‘*********************************************************************
Call SetFilter(BaseAdrs, 4, 12.5 * 2.55)
F
Int 2.55
P
×
(
)
=
t
NumActiveChannels
–
45
ln
F
256
---------
×
-----------------------------------------------------
≅