beautypg.com

Getgagecal, 4 getgagecal – Sensoray 118 User Manual

Page 30

background image

Sensoray Model 118 Smart A/D™ Instruction Manual

28

Commands: Pressure/Strain Gage

6.4.4 GetGageCal

Returns the Smart A/D™ internal calibration parameters
for a strain gage channel. The response string is six bytes
long.

The data byte values that are returned in the command
response are represented in an internal format that is
meaningful only to the Smart A/D™.

In order for the command response bytes to have
legitimate values, the strain gage channel must already
have been calibrated. This prior calibration may be
accomplished in either of two ways: using the

SetGageZero

and

SetGageSpan

commands, or using

the

SetGageCal

command.

Driver

// Copy the specified channel’s gage parameters into an array. The

// target channel must be configured for a strain gage sensor and

// must be calibrated before calling this procedure.

VOID GetGageCal( USHORT BasePort, UCHAR Channel, SHORT *pArray )

{

SendByte( BasePort, Channel | CMD_GET_GAGECAL );

for ( USHORT parm = 0; parm < 3; parm++ )

*pArray++ = ReadWord( BasePort );

}

Example

// Fetch the gage calibration parameters from channel 6.

SHORT GageParms[3];

GetGageCal( MyBasePort, 6, GageParms );

Command: (128 + Chan),(SensorDefinitionCode)

Response:

(S0),(S1),(S2),(S3),(S4),(S5)

This manual is related to the following products: