oCompassVX Object
An Object that reads a Vector V2X Compass.
Description:
 

A Hardware Object that reads a Vector 2X Compass Module and returns a URCP Heading value.

Operation:
 

The oCompassVX Object uses the 5 I/O lines specified by the IOGroup property to read a Vector 2X Compass Module which returns a value of 0 - 359. Once the data read has been completed, the Scale property is checked. If it is 0, then the data is converted to an URCP Heading value. If the Scale is 1, then the value remains unchanged. Once the scale has been determined, the value is stored in the Value property.

Storage size & Availability:
 

The following table lists the size and availability of the oCompassVX Object and its variations:

ObjectSizeVersion
oCompassVX9 BytesB.1.0
Properties:
 

The following table lists the Properties of the oCompassVX Object:

PropertyDescription
Address

Returns a pointer to the address of the oCompassVX Object instance.

Data-Type: Address, Read-Only

Data-Range: 0 - 127

IOGroup

A value that specifies which physical I/O Group to use.

Data-Type: Nibble

Data-Range: 0 - 3

NonZero

A value that indicates if the Value property is 0 or not.

Data-Type: Bit, Flag

Data-Range: 0 - 1

Operate

A value that specifies whether or not the data is updated.

Data-Type: Bit, Flag

Data-Range: 0 - 1

Scale

A value that specifies the scale of the Value property

Data-Type: Nibble

Data-Range: 0 - 1

Unsigned

A value that specifies if the Value property is a signed value or not.

Data-Type: Bit

Data-Range: 0 - 1

Value

A value that indicates the current compass heading.

Data-Type: Word, Default

Data-Range: 0 - 360

Example:
 In the following example, the oCompassVX Object is used to detect the direction that the Vector 2X compass Module is facing and displays that direction as a binary number on I/O group 1.
' This program reads a Vector 2X compass
' Module and displays the binary 
' result on I/O Lines 8 - 15.

Dim C As New oCompassVX
Dim D As New oDio8

Sub Main()
  C.IOGroup = 3
  C.Operate = cvTrue
  D.IOGroup = 1
  D.Direction = cvOutput
  Do
    D.Value = C.Value
  Loop
End Sub                          
Connections:
 The oCompassVX uses 5 I/O lines.  The 5 I/O lines can be in I/O Group 1, 2, or 3 and are the first 5 lines of any of the 3 groups.
Vector 2X Compass ModuleSocket Wiring Diagram

PinNameDescriptionI/O BitIOGroup
123
P1SCLKSerial ClockBit-2101826
P2SDOSerial Data OutputBit-191725
P3SDISerial Data Input    
P4SSSlave SelectBit-081624
P5PCPoll / ContinuousBit-081624
P6CALCalibrate    
P7RESResolution    
P8M/SMaster / Slave    
P9BCD/BinBCD / Binary    
P10Y FlipFlip Y-axis    
P11X FlipFlip X-axis    
P12CICalibrate indicator    
P13EOCEnd of ConversionBit-3111927
P14RAWRaw data mode    
P15VCC+5 Volt power+5 Volts   
P16GNDPower ReturnGnd   
P17RESETResetBit-4122028
See Also:
 

oCompassDN - An Object that reads a Dinsmore 1490 Compass.