8 sensor acquisition functions – Sensoray Smart A/D User Manual

Page 15

Advertising
background image

S

ENSORAY

I

NSTRUCTION

M

ANUAL

S

MART

A/D D

RIVER

FOR

W

INDOWS

Page 13

Example:

///////////////////////////////////////////////////////////////////////////

// Program board number 3, channel 7, to interface to a K Thermocouple.

///////////////////////////////////////////////////////////////////////////

#define KTC 12 // Logical Sensor Definition Code for K Thermocouple.

SetSensorType( 3, 7, KTC );

3.8 Sensor Acquisition Functions

3.8.1 GetAmbientTemp()

Function:

Returns the ambient temperature from a Sensoray termination board. The returned temperature value is from the
thermocouple cold-junction compensation sensor that is present on all Smart A/D™ termination boards. This
function is useful as a diagnostic tool as it can be used to acquire digitized data from the Smart A/D™ subsystem
without depending on the presence of external sensors.

Prototype:

double GetAmbientTemp( long hBD, long tb );

Example:

///////////////////////////////////////////////////////////////////////////

// Fetch the ambient temperature from board 3 at the TB connected

// to the lowest channels.

///////////////////////////////////////////////////////////////////////////

GetAmbientTemp( 3, 0 );

Resistance

27

400 ohm range

28

3K ohm range

29

600K ohm range

Other

31

Disabled: remove channel from scan list

Parameter

Type

Description

hBD

long

Board handle.

tb

long

Specifies the termination board (TB) to be addressed:
8-channel Models: always set to zero.
16-channel Models: 0 = TB for channels 0 to 7, 1 = TB for channels 8 to 15.
32-channel Models: 0 = TB for channels 0 to 15, 1 = TB for channels 16 to 31.

return value

long

TB temperature, in degrees C.

Input Class

LSDC

Input Range / Sensor Type

Advertising