oBit Object

Main Index
Object List
Back to top of page Description:

 

The oBit Object manages a 1-Bit variable that can be used in a virtual circuit.  As well as the value of the variable, status properties are also provided that can be used in a virtual circuit.

There are three main differences between this object and a standard Bit variable. 

  1. This Object's Value property is an instance of the oValue Object which can be pointed to by a Virtual Circuit. 
  2. This Object maintains status bits which can be pointed to by Virtual Circuits.
  3. This Object is 7-bits larger in order to store the status information.
 The following table lists the size and availability of the oBit Object.
 ObjectSizeDescriptionA1A2B1B2C1
oBit1 ByteManages a value with a range of 1 to 0.xxxxx
Back to top of page Operation:
 

An oBit Object variable stores a 1 bit value in its Value property and maintains other values that represent the status of that 1 bit.

Since the Value property of the oBit Object is an oValue property, Virtual Circuits that have an oValue pointer can point to it.  In addition, to keep backwards compatibility, the compiler will treat the Value property as on oLogic object as well.  Therefore, A Virtual Circuit connection may be made to the Value property by either an oValue pointer or an oLogic pointer.

Back to top of page Properties:
 

The following table lists the properties of the oBit Object:

Property

Description

Value
The value of the 1-bit variable.
Object Class: oValue Value Range: 0 - 1
Data Type: Numeric Default Value: 0
IsSet
A value that indicates if the value is 1.
Object Class: oProperty Value Range: 0 - 1
Data Type: Numeric (Read-Only) Default Value: 0
IsClear
A value that indicates if the value is 0.
Object Class: oProperty Value Range: 0 - 1
Data Type: Numeric (Read-Only) Default Value: 0
Data
The data for the Value property.
Object Class: oVar1 Value Range: 0 to 1
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 oBit Object:
MethodsDescription
Clear

Clears the Value property to 0.

Invert

Toggles the bit in the Value property

Set

Sets the Value property to 1.

Init

Initializes the value when the object is created.

Back to top of page Example:

 The following examples use the oBit Object.
Visual Basic SyntaxC and Java Syntax
Dim A As New oBit
Dim B As New oNibble
Dim C As New oByte
Dim D As New oWord

Sub Main()  
  A = 1
  B = 2  
  C = 3
  D = 4
End Sub
oBit A = New oBit;
oNibble B = New oNibble;
oByte C = New oByte;
oWord D = New oWord;

Void Main(Void){
  A = 1;
  B = 2;
  C = 3;
  D = 4;
}
Basic Syntax 
A As oBit
B As oNibble
C As oByte
D As oWord

A = 1
B = 2  
C = 3
D = 4
 

Back to top of page Related Items:

 The following table lists objects that use the oBit Object.
 ObjectDescriptionA1A2B1B2C1
oDIO1Provides a 1 line digital I/O.xxxxx
oStepperControls a stepper motor.xxx
oStepperSPControls a stepper motors speedxx
 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oNibManages a 4-bit value with a range of 0 to 15.xxxxx
oNibXManages a 4-bit signed value with a range of -8 to +7.x
oByteManages a 8-bit value with a range of 0 to 255.xxxxx
oCharManages a 8-bit signed value with a range of -128 to -127.xxx
oWordManages a 16-bit value with a range of 0 to 65,535.xxxxx
oIntManages a 16-bit signed value with a range of -32,768 to +32,767.xxx
oBuffer(1-32)32 Objects that Manage various sized data-buffer/string variable.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.