beautypg.com

Making measurements, Operation, 6 making measurements – PNI CompassPoint V2Xe User Manual

Page 18

background image

V2Xe User Manual

– May 2012

Page 16

kSetCalData (frame ID 0x0E)

This frame writes calibration data into the V2Xe using the same frame structure as

kCalDataResp. This is an optional command and is not used for most applications.

However, it allows the user to store multiple sets of calibration coefficients on the

host system, and write them into the V2Xe when appropriate. For example, if the

host system has a motor that sometimes is off and sometimes on, then one set of

calibration coefficients can be generated and stored in the host system for when the

motor is on, and a second set for when the motor is off. The first set of calibration

coefficients would be written to the V2Xe whenever taking a reading with the motor

on, and the second set whenever the motor is off.

5.6

Making Measurements

To make a measurement, it is first necessary to establish what data is to be output by sending

the kSetDataComponents frame. The kGetData command is sent to initiate a measurement,

and the response will be the kGetDataResp frame which will contain the measured data, as

established by kSetDataComponents.

kSetDataComponents (frame ID 0x03)

This frame defines what data is output when kGetData is sent. Table 5-4 summarizes

the various data components and more detail follows this table. The first byte of the

payload indicates the number of data components followed by the data component

IDs.

Example: To query for heading and magnitude, the payload should contain:

Note that the sequence of the data components defined by kSetDataComponents will

match the output sequence of kGetDataResp.

0x02

Heading ID

0x05

ID Count

Payload

0x06

Magnitude ID

ID Count

UInt8

ID 1

UInt8

Payload

ID 2

ID 3

UInt8

UInt8

……….