oBuffer Object

Back to top of pageDescription:
 A Variable Object that consists of an array of up to 32 Bytes.
 The following table lists the size and availability of the oBuffer Object and its variations.
 ObjectSizeDescriptionA1A2B1B2C1
oBuffer15 BytesCopies the value of an oLogic Object to another oLogic Object.xxxxx
oBuffer26 BytesCopies the value of an oLogic Object to 2 other oLogic Objects.xxxxx
oBuffer37 BytesCopies the value of an oLogic Object to 3 other oLogic Objects.xxxxx
oBuffer4 - oBuffer29xxxxx
oBuffer3034 BytesCopies the value of an oLogic Object to 2 other oLogic Objects.xxxxx
oBuffer3135 BytesCopies the value of an oLogic Object to 3 other oLogic Objects.xxxxx
oBuffer3236 BytesCopies the value of an oLogic Object to 4 other oLogic Objects.xxxxx
Back to top of pageOperation:
 An oBuffer Object maintains an array of bytes. Access to the array of bytes can be done as a string of characters or by specifying one byte within the array with a Location property.

The value that is read or written by using the Value property will be the character that the Location property points.

When accessing the array as a string of characters, The VString property is used to read or write a series of characters and the RTCString property is used to read or write a series of characters represented as an Real-Time-Clock string

When reading from the VString property, each character within the buffer will be sequentially read each time the VString property is accessed. When writing to the VString property, the characters will be written to the buffer starting at the first character position.

When writing as a string of characters, each character written will be sequentially stored starting at position 1. When accessing the array by specifying a single byte, the Value property is used to read or write a specified byte within the array and the location of the byte that gets read from or written to is specified by the Location property. 

When reading from the RTCString property each character written will be sequentially stored starting at position 1 with a colon between pairs of digits.

Back to top of pageProperty Options:
 The oBuffer Object has 32 variants which are selected with the property options 1 through 32.
  • 1 specifies that there is 1 byte in the buffer. 
  • 2 specifies that there are 2 bytes in the buffer.
  • 3 specifies that there are 3 bytes in the buffer.
  • ... 4 to 29
  • 30 specifies that there are 30 bytes in the buffer.
  • 31 specifies that there are 31 bytes in the buffer.
  • 32 specifies that there are 32 bytes in the buffer.
 Continuous
operation
       Continuous
operation
One Byte ArrayoBuffer Thirty Byte ArrayoBuffer30
Two Byte Array oBuffer2 Thirty-One Byte Array oBuffer31
Three Byte ArrayoBuffer3 Thirty-Two Byte ArrayoBuffer32
Back to top of pageProperties:
 

The following table lists the properties of the oBuffer Object:

Property

Description

Value
The byte within the oBuffer Object's array pointed to by the Location property
Object Class: oValue Value Range: 0 - 255
Data Type: Numeric Default Value: 0
VString
The entire contents of the oBuffer Object's array expressed as a string.
Object Class: oValue
Data Type: String
RTCString
The entire contents of the oBuffer Object's array expressed as an Real-Time-Clock String
Object Class: oValue Value Range: 0 - 255
Data Type: String Default Value: 0
An RTC-String is created by placing a colon between pairs of digits.  For example; if an oBuffer6 contained the digits: "123456", the RTCString property would return "12:34:56"

Data-Type: String

Availability: oBuffer4,  oBuffer6,  oBuffer8

Location
A number that is used to specify a specific byte within the oBuffer object's array.
Object Class: oVar5 Value Range: 0 - 31
Data Type: Numeric Default Value: 0
The Location property is moved to the next array position in the direction specified by the Direction property each time the Value property is read or written.

This value is 0-based.  A value of 0 specifies the first byte, A value of 1 specifies the second byte, ect... 

NonZero
A value that is set to 1 when any byte in the oBuffer object's array is not zero and cleared to 0 when each byte in the oBuffer object's array is 0.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
The following table list the values of the NonZero Property:
NonZeroDescription
0The entire array is filled with zeros.
1One or more element in the array is more than zero.
Width
The number of characters specified (-1) when the Object instance was created.
Object Class: oVar5 Value Range: 0 - 31
Data Type: Numeric (Read-Only) Default Value: 0
Note that this value is 1 less that the actual number characters specified.
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 pageExample:
 In the following example, a Virtual Circuit is created that uses the oRTC Object to update the oBuffer Object with the digits in a Real-Time-Clock.  The program also sends the contents of the oBuffer in a Real-Time-Clock format to an oLCD Object.
Visual Basic Syntax C and Java Syntax
'This program creates a Virtual
'Circuit that displays the time
'on a LCD Module.

Dim L As New oLCD
Dim T As New oRTC
Dim B As New oBuffer8

Sub main() 
  T.ClockIn1.Link(ooPIC.Hz1)
  T.Output.Link(B)
  T.Operate = 1
  L.IOGroup = 3
  L.IOLineRS = 26
  L.IOLineE = 27
  L.Nibble = 1
  L.Operate = 1
  L.Init
  L.Clear
  Do
    L.Locate(0,0)
    L.VString = B.RTCString 
    ooPIC.Delay = 1000
  Loop
End Sub 
// This program creates a Virtual
// Circuit that displays the time
// on a LCD Module.

oLCD L = New oLCD;
oRTC T = New oRTC;
oBuffer8 B = New oBuffer8;

Void main(Void){
  T.ClockIn1.Link(ooPIC.Hz1);
  T.Output.Link(B);
  T.Operate = 1;
  L.IOGroup = 3;
  L.IOLineRS = 26;
  L.IOLineE = 27;
  L.Nibble = 1;
  L.Operate = 1;
  L.Init;
  L.Clear;
  Do{
    L.Locate(0,0);
    L.VString = B.RTCString;
    ooPIC.Delay = 1000;
  } While (1);
}
Basic Syntax 
'This program creates a Virtual
'Circuit that displays the time
'on a LCD Module.

L As oLCD(3,1,27,26,cvOn)
T As oRTC(ooPIC.Hz1,B,,,cvOn)
B As oBuffer8

L.Init
L.Clear
Do
  L.Locate(0,0)
  L.VString = B.RTCString 
  ooPIC.Delay = 1000
Loop
 

Back to top of pageRelated Items:

 The following table lists other objects with related functions.
 ObjectDescriptionA1A2B1B2C1
oRTCCauses an oBuffer Object to maintain a Real Time Clock.xxxxx
oByteManages a 8-bit value with a range of 0 to 255.xxxxx
oWordManages a 16-bit value with a range of 0 to 65,535.xxxxx
Back to top of pageVersion History and Bug List:
 Firmware Ver A1: Introduced.

Bugs: No known bugs.


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