Sensoray Smart A/D User Manual
Page 17

S
ENSORAY
I
NSTRUCTION
M
ANUAL
S
MART
A/D D
RIVER
FOR
W
INDOWS
Page 15
Special driver functions are provided to simplify the software interface to strain and pressure gauges. These functions apply only
to Smart A/D™ models that support interface to gauges. Invoking these functions on models that do not support gauges may
cause unpredictable behavior and should be avoided. Refer to your Smart A/D™ Instruction Manual to determine if your model
supports gauges.
All of the gauge-related functions specify a channel number parameter which designates the channel to be affected by the
function. Gauge functions assume that the referenced channel has been previously configured for interface to a gauge by means
of the SetSensorType() function.
3.9.1 SetGageZero()
Function:
Registers a “zero load” condition with the Smart A/D™ board. This function is invoked as the first step of a
two-step physical gauge calibration procedure. Refer to your Smart A/D™ Instruction Manual for detailed
information regarding gauge calibration.
Note: the applied load need not be a true “zero” load. It is only required that the physical load that is present when
this command executes also is applied when the SetGageSpan() function executes.
Prototype:
void SetGageZero( long hBD, long channel );
Example:
///////////////////////////////////////////////////////////////////////////
// Start a physical gauge calibration on board 3, channel 5.
// Assumes: (1) channel 5 is configured for a strain/pressure gauge, and
// (2) the gauge on channel 5 has a Zero Load condition.
///////////////////////////////////////////////////////////////////////////
SetGageZero( 3, 5 );
3.9.2 SetGageSpan()
Function:
Registers a “full load” condition with the Smart A/D™ board. This function is called as the final step in a two-step
physical gauge calibration procedure.
A gauge load parameter, load, must be specified when this function is called. This value represents the difference
between the load that is applied when SetGageZero() was called and the load that is applied when
SetGageSpan()
is called. The load is always specified as an integer, as the Smart A/D™ board inherently
produces an integer data value for any arbitrary load condition. The value of load is determined by dividing the
applied physical load by the desired resolution. The resulting value must fall within the range -32768 to +32767.
For example, suppose the applied load is 2,000 pounds and a resolution of 0.1 pounds is desired. The load
parameter should be set to 2,000 / 0.1 = 20,000. After executing this command, the
GetSensorData()
function will return sensor data from this channel in units of 0.1 pounds. In this case, an
applied load of 153.7 pounds, for example, would cause GetSensorData() to return the value 1537.
Prototype:
void SetGageSpan( long hBD, long channel, long load );
Parameter
Type
Description
hBD
long
Board handle.
channel
long
Sensor channel number to be affected.
Parameter
Type
Description
hBD
long
Board handle.
channel
long
Sensor channel number to be affected.
load
long
Applied physical load, ranging from -32768 to +32767. This value is the number
you should expect to measure at the applied load condition when calling
GetSensorData()
.