oValue Object

Back to top of page Description:
 The oValue Object manages values so that they can be used in a Virtual Circuit.  
 The following table lists the size and availability of the oValue Object.
 ObjectSizeDescriptionA1A2B1B2C1
oValue A linkable Object used for virtual circuits.xxxxx
Back to top of page Operation:
 The oValue Object communicates with its parent object in order to store and retrieve data.  For instance, the oByte Object uses this object so that a Virtual Circuit can read and write the 8-Bit value that the oByte Object stores.  Likewise, the oWord Object does exactly the same thing but with a 16-bit value.

Various methods such as Dec, Inc, Clear LShift, etc, provide common methods for the parents objects as well.

Note that the oValue Object does not store any values itself.  It is just a common "point-to" object created so that Virtual Circuits can point to objects that have different magnitudes in value.

Back to top of page Properties:

The following table lists the properties of the oValue Object:

Property

Description

Value
The routine that retrieves and stores the parent object's numeric value.
Object Class: oProperty Value Range: 
Data Type: Numeric Default Value: 0
Address
Returns a pointer to the address of the oCounter Object instance.
Object Class: oAddress Value Range: 0 - 127
Data Type:Pointer (Read Only) Default Value: Address of Object

Back to top of page Methods:
 The following table lists the Methods of the oValue Object:
MethodsDescription
ClearClears the Value to 0.
DecDecrements the Value by 1.
IncIncrements the Value by 1.
InvertInverts the bits in the Value.
LShiftShifts the bits in the Value left.
RShiftShifts the bits in the Value Right.
SetSets the Value so that all the bits are 1.

Back to top of page Example:

The following examples use the oValue Object.
Visual Basic SyntaxC and Java Syntax
' This program demonstrates
' some of the methods of
' the oValue object.

Dim T As New oTone

Sub main()
  T.IOLine = 21
  T.Operate.TurnOn
  Do
    T.Value = 60
    ooPIC.Delay = 300
    T.Value.LShift
    ooPIC.Delay = 300
    T.Value.RShift
    ooPIC.Delay = 300
    T.Value.Clear
    ooPIC.Delay = 300
  Loop
End Sub  
// This program demonstrates
// some of the methods of
// the oValue object.

oTone T = New oTone;

Void main(Void){
  T.IOLine = 21;
  T.Operate.TurnOn;
  Do{
    T.Value = 60;
    ooPIC.Delay = 300;
    T.Value.LShift;
    ooPIC.Delay = 300;
    T.Value.RShift;
    ooPIC.Delay = 300;
    T.Value.Clear;
    ooPIC.Delay = 300;
  } While (1);
} 
Basic Syntax 
' This program demonstrates
' some of the methods of
' the oValue object.

Dim T As New oTone(21,0,cvOn)

Do
  T.Value = 60
  ooPIC.Delay = 300
  T.Value.LShift
  ooPIC.Delay = 300
  T.Value.RShift
  ooPIC.Delay = 300
  T.Value.Clear
  ooPIC.Delay = 300
Loop 
 

Back to top of page Related Items:

 The following table lists objects that use the oValue Object.
 ObjectDescriptionA1A2B1B2C1
oA2D10Measures the level of the voltage on an input line with an 10-bit result.xx
oA2D8Measures the level of the voltage on an input line with an 8-bit result.xxxxx
oA2DXMeasures the level of the voltage on an input line and detects when it is below a threshold.xxx
oBitAn Object that manages a value with a range of 1 to 0.xxxxx
oBufferAn Object that manages a variable size data-buffer/string variable.xxxxx
oBumper4Reads a 4-contact bumper.xxx
oBumper8Reads an 8-contact bumper.xx
oByteAn Object that manages a value with a range of 0 to 255.xxxxx
oCharAn Object that manages a value with a range of -128 to -127.xxx
oCompareCompares an Object's Value to set points.xxx
oCompassDNReads a Dinsmore 1490 Compass.xxx
oCompassVXReads a Vector V2X Compass.xxx
oCounter2HAn Object that counts the number of high-speed cycles on a hardware specific pin.xxx
oDCMotorControls a DC motor that is driven by an LMD18200 H-Bridge driver.xxx
oDCMotor2Controls a DC motor that is driven by an L293 H-Bridge driver.xx
oDIO16Provides a 16 line digital I/O.xxxxx
oDIO4Provides a 4 line digital I/O.xxxxx
oDIO8Provides an 8 line digital I/O.xxxxx
oDistanceAn Object that manages a URCP distance value.xxx
 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oLogicA Boolean Object used for virtual circuits.xxxxx
Back to top of page Version History and Bug List:
 Firmware Ver A1: Introduced.

Bugs: No known bugs.


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.