The oQEncode 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 two inputs are expected to be connected to a quadrant encoder but any quadrant style inputs will enable the oQEncode Object to operate correctly.
The oQEncode 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 Position property is incremented. If the second input is different than the first, then the Position 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.
If the second input is the same as the first, then the Position property is incremented. If the If the second input is different than the first, then the Position property is decremented.
A value that specifies if the count has moved. This value is updated each time the oQEncode Object evaluates the inputs and therefore each time the Position property changes, the Moved property is set to cvTrue.
In firmware B.x this value is valid for one link list loop. In firmware C.x this value is User-Cleared.
In the following example, the oQEncode Object is used.
'This program reads an oQencode Object
'and outputs the value on I/O lines 8 - 15.
Dim A As New oQencode
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