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.
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.
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.
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).
1
cvStore
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.
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