Sensoray 2600 User Manual
Page 46

Sensoray 2600 Programming Guide
42
Gateway Action Scheduling
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
S26_2612_RegisterZero()
was called and the load that is applied when
S26_2612_RegisterSpan()
is called. For example, suppose the applied load is 2,000 pounds. The
load
parameter should be set to 2,000.0. After executing this command,
S26_Sched2612_GetCalibratedValues()
will return data from this channel in units of pounds. In this case, an applied load of 153.7 pounds, for example,
would cause
S26_Sched2612_GetCalibratedValues()
to return the value 153.7.
Note that this function performs its action when called, unlike many other middlware functions that simply
schedule future actions.
Example:
// Set span to 2000 pounds on the 2612 at MM number 0, IOM port 10, channel 2.
S26_2612_RegisterSpan( 0, 10, 1000, 2, 100, 2000.0 );
7.6.9 S26_2612_RegisterTare()
Measures and calculates the “permanent offset” (i.e., tare) value for one channel on a model 2612 IOM
Prototype:
u32 S26_2612_RegisterTare( u32 hbd, IOMPORT IomPort, u32 msec, u8 chan, u32 nsmp );
Returns:
Error code as described in section 5.5. Zero is returned if the operation was successful.
Benchmark:
(tsample + 0.4 ms) * nsmp
, where
tsample
is the target channel’s sample period.
Notes:
This function calculates the “permanent offset” (tare) value and stores the value in an internal buffer. The actual
tare value must be applied to the corresponding channel’s input before start of calibration and held until the
function returns. Taring is accomplished by adjusting the data offset so that data returned by
S26_Sched2612_GetCalibratedValues()
will equal zero at the current load condition.
When this function executes,
nsmp
measurements are taken, the average value is calculated and stored as the
“permanent offset” (tare) for one channel. The stored value will be used later to calculate corrected values.
Note that this function performs its action when called, unlike many other middlware functions that simply
schedule future actions.
Example:
// Register tare on the 2612 at MM number 0, IOM port 10, channel 2.
S26_2612_RegisterTare( 0, 10, 1000, 2, 100 );
7.6.10 S26_2612_GetCalibratedValue()
Calculates and returns the corrected, measured value for one channel on a model 2612 IOM.
Prototype:
double S26_2612_GetCalibratedValue( u32 hbd, IOMPORT IomPort, u8 chan, u32 *sample );
Returns:
Calibrated value.
Parameter
Type
Description
hbd
u32
MM handle.
IomPort
u8
The IOM port number (on the MM) to which the target IOM is connected.
msec
u32
Maximum time to wait for the gateway response packet, in milliseconds, before declaring a
time-out.
chan
u8
The channel number that is to be registered. Legal values range from 0 to 3.
nsmp
u32
Number of samples used to average calibration result.
Parameter
Type
Description
hbd
u32
MM handle.
IomPort
u8
The IOM port number (on the MM) to which the target IOM is connected.
chan
u8
The channel number that is to be registered. Legal values range from 0 to 3.
sample
u32 *
Pointer to 32bit buffer to receive the sample counter value.