Channel configuration, Setsensortype, 2 channel configuration – Sensoray 118 User Manual
Page 20

Sensoray Model 118 Smart A/D™ Instruction Manual
18
Commands: Channel Configuration
6.2 Channel Configuration
6.2.1 SetSensorType
Declares the type of sensor connected to a channel. By
declaring the sensor type, you are implicitly selecting the
excitation mode, measurement gain setting and
linearization curve. After executing this command, the
onboard microcomputer will perform all subsequent
scans of the specified channel as appropriate for the
declared sensor type.
This function has several side-effects that should be
noted:
• Sensor data is not available immediately after declaring
a channel’s sensor type. After executing this function,
sensor data is reset to zero. The maximum elapsed
time that must pass before new sensor data becomes
available is equal to ten channel slot times. Details of
channel slot timing can be found in Section 8.1.
• The channel filter constant (Section 6.2.3) is reset to
zero, effectively disabling the software filter function.
• Limit alarms (Section 6.5.1) are disabled, as the new
sensor type may have a new type of engineering units.
Typically, the host will execute this command once for
each sensor channel. Each execution declares the sensor
type for one channel, therefore eight invocations must
occur to declare all channel sensor types.
Each sensor type supported by the Smart A/D board is
assigned a unique value, called the Sensor Definition
Code (SDC). This value, along with the target sensor
channel number, is passed to the Smart A/D board as a
function argument.
Upon reset of the Smart A/D board, all channel sensor
types default to the ±5 Volt input range, with 500µV
resolution, and all sensor data values are reset to zero.
Channel sensor types remain at the default setting until
changed by this function. If the default sensor type is
suitable for your application, you need not execute this
function at all.
Any attempt to declare an unsupported sensor type will
result in selection of the default sensor type.
Declaring a sensor type as “Disabled” inhibits scanning
of the corresponding channel, resulting in increased
throughput for all remaining active channels.
See Table 9 on page 36 for a complete list of supported
sensor types and SDCs.
Driver
// Configure a channel for the specified sensor type.
VOID SetSensorType( USHORT BasePort, UCHAR Channel, UCHAR SensorDefCode )
{
SendByte( BasePort, Channel | CMD_SET_TYPE );
SendByte( BasePort, SensorDefCode );
}
Example
// Configure channel 2 for interface to a K thermocouple.
SetSensorType( MyBasePort, 2, TYPE_TC_K );
Command: (16 + Chan),(SensorDefinitionCode)
Response:
None