The oCounter2L Object monitors the inputs to the two I/O lines specified by the IOLine1 and IOLine2 properties and will increment or decrement the Position property as the two inputs change.
The oCounter2L Object evaluates the two inputs as follows: The first Input line is used as a clock while the second I/O line is used as a direction input. This results in a single count for each time the first input changes. The direction of this count is determined by the state of the second input. If the second input is the same as the first, then the Count property is incremented. If the second input is different than the first, then the Count property is decremented. Each time the count changes, the Direction property is updated with the direction of the change and the Moved property is set.
A value that indicates the position of the quadrant encoder. If the second input is the same as the first, then the Count property is incremented. If the If the second input is different than the first, then the Count property is decremented
In the following example, the oCounter2L Object is used.
'This program reads an oCounter2L Object
'and outputs the value on I/O lines 8 - 15.
Dim A As New oCounter2L
Dim B As New oDIO8
Sub Main()
ooPIC.PullUp = 1
A.IOLine1 = 8
A.IOLine2 = 10
A.Operate = cvTrue
B.IOGroup = 3
B.Direction = cvOutput
Do
B=A
Loop
End Sub