oIndex Object

Back to top of page Description:
 A Processing Object that stores or retrieves values from an array of values or optionally searches the array for a specified value. It is capable of doing encoder / decoder / multiplexer / demultiplexer / lookup functions.
 The following table lists the size and availability of the oIndex Object.
 ObjectSizeDescriptionA1A2B1B2C1
oIndex4 BytesProvides indexing functions.xxxxx
oIndexC6 BytesProvides indexing functions.xxx
Back to top of page Operation:
 

An oIndex Object points to a oBuffer Object that contains an array of information and stores or retrieves the value at the location within the array specified by the oIndex Object.

Back to top of page Property Options:
 The oIndex Object has 2 variants which are selected with the property option C.
  • C specifies that the object is clocked.
Continuous
operation
Clocked
operation
oIndexoIndexC
Back to top of page Properties:

The following table lists the properties of the oIndex Object:

Property

Description

Operate
A value that selects whether or not the values are updated.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe operation is not performed.
1cvOnThe operation is performed.
Unit
A pointer to an object whose value is used to stored data transferred to or from the Array object.
Object Class: oValuePtr Value Range: Any oValue Object
Data Type: Pointer Default Value: Null
Index
A pointer to an object whose value holds the position within the Array object at which values are to be stored or retrieved.
Object Class: oValuePtrI Value Range: Any oValue Object
Data Type: Pointer Default Value: Null
The offset to the {Index}th position within the Array object is 0 based and is calculated as follows: (the bit-wide size of the object pointed to by Unit) * (the Value of the object pointed to by Index) + 1.
Array
A pointer to a oBuffer Object from which values are returned from or stored to.
Object Class: oBufferPtr Value Range: Any oBuffer Object.
Data Type: Pointer Default Value: Null
Direction
A value that selects the direction of data flow.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
DirectionConstantDescription
0cvRetrieve

Retrieves the {Index}th value out of the Array Object and places it into the Value of the Unit Object.
This can also be done in code by using the value returned when specifying a oBuffer Object's subscript. I.E. X = Buffer(3).

1cvStore

Stores the Value of the Unit Object into the {Index}th position of the Array Object.
This can also be done in code by assigning a byte by specifying a oBuffer Object's subscript to a value. I.E. Buffer(2) = 13.

Process
Clock
See Clocked Objects for detail
Object Class: oClockedOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Availability: oIndexC
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 Examples:
 In the following example, the oIndex Object is used
'This program creates a Virtual
'Circuit that increments the
'first byte in a buffer and
'then uses an oIndex to copy
'that first byte to an oDio8.

Dim I As New oIndex
Dim B As New oBuffer(8)
Dim D As New oDIO8
Dim X As New oByte
 
Sub main() 
  ooPIC.Node = 5
  I.Array.Link(B)
  I.Index.Link(X)
  I.Unit.Link(D)
  I.Operate = cvTrue
  X.Value = 0
  B.Location = 0
  D.IOGroup = 1
  D.Direction = cvOutput
  Do
    B.Value = B.Value + 1
  Loop
End Sub

Back to top of page Related Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oBufferAn Object that manages a variable size 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.