Sensoray 2600 User Manual

Page 45

Advertising
background image

Sensoray 2600 Programming Guide

41

Gateway Action Scheduling

Prototype:

u32 S26_2612_RegisterZero( 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 is part of the calibration process for an analog input channel. It calculates the “zero offset” value for
an analog input channel and stores the value in an internal buffer. The target channel will be measured in rapid
succession a number of times, as specified by nsmp. The resulting digitized values are averaged and then stored
for later use. Later, when the application program samples the analog input, the offset value is used to offset-adjust
the resulting digital data value.

When this function is called, an actual zero value reference signal must be applied to the measurement inputs of the
target analog input channel, and the reference level must be held constant until the measurement is finished.

Note that this function performs its action when called, unlike many other middlware functions that simply
schedule future actions.

Example:

// Register zero values on the 2612 at MM number 0, IOM port 10, channel 2.

S26_2612_RegisterZero( 0, 10, 1000, 2, 100 );

7.6.8 S26_2612_RegisterSpan()

Measures and calculates the “positive full scale” value for one channel on a model 2612 IOM.

Prototype:

u32 S26_2612_RegisterSpan( u32 hbd, IOMPORT IomPort, u32 msec, u8 chan, u32 nsmp, double load );

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 “positive full scale” value and stores the value in an internal buffer. The actual
positive full scale value must be applied to the corresponding channel’s input before start of calibration and held
until the function returns. This function is called as the final step in a two-step physical gauge calibration
procedure.

When this function executes,

nsmp

measurements are taken, the average value is calculated and stored as the

“positive full scale” value for one channel. The stored value will be used later to calculate corrected values.

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.

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.

load

double

Actual value applied to the channel input in any user’s units.

Advertising