9 strain/pressure gauge functions – Sensoray Smart A/D User Manual

Page 16

Advertising
background image

S

ENSORAY

I

NSTRUCTION

M

ANUAL

S

MART

A/D D

RIVER

FOR

W

INDOWS

Page 14

3.8.2 GetAllSensors()

Function:

Returns sensor data from all channels on the specified board. The returned values are represented in engineering
units that are appropriate for the sensor type. For example, channels configured for voltage measurement always
return Volts. Channels configured for temperature sensors typically return Degrees Centigrade units.

Note: Visual Basic Version 5 has a bug that may cause unpredictable side-effects as a result of calling this
function. If you are using VB5, we recommend that you do not use this function, but instead make multiple calls to
the GetSensorData() function to obtain sensor data.

Prototype:

void GetAllSensors( long hBD, double *databuf );

Example:

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

// Fetch all sensor data from board 3, then extract the sensor data from

// channel 6, which has been previously configured for interface to a type

// K thermocouple.

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

#define NCHANS 16 // Assume this is a 16-channel Smart A/D board

double SensorData[NCHANS]; // Allocate a large-enough buffer for all sensor chans

GetAllSensors( 3, SensorData ); // Copy all sensor data to buffer

double DegreesC = SensorData[6]; // Extract channel 6 sensor data

3.8.3 GetSensorData()

Function:

Returns sensor data from one channel. The returned value is represented in the engineering units that are
appropriate for the sensor type. For example, channels configured for voltage measurement always return Volts.
Channels configured for any type of temperature sensor always return Degrees Centigrade units.

Prototype:

double GetSensorData( long hBD, long channel );

Example:

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

// Fetch the sensor data from board 3, channel 6, which has been

// previously configured for interface to a Platinum 1K Ohm RTD.

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

double DegreesC = GetSensorData( 3, 6 );

3.9 Strain/Pressure Gauge Functions

This section is applicable if you are using strain or pressure gauges.

Parameter

Type

Description

hBD

long

Board handle.

databuf

double*

Address of an array of doubles that will be filled with sensor data from all
channels on the specified board. To prevent system faults, make sure the
array is large enough to contain data from all channels on the target board.

Parameter

Type

Description

hBD

long

Board handle.

channel

long

Board handle.

return value

long

Board’s physical address. as described in section 3.2.

Advertising