Difference between revisions of "Component: Quadrature Encoder (General Input)"

From Flowcode Help
Jump to navigationJump to search
Line 5: Line 5:
 
|-
 
|-
 
| width="20%" style="color:gray;" | Version
 
| width="20%" style="color:gray;" | Version
| 1.4
+
| 1.5
 
|-
 
|-
 
| width="20%" style="color:gray;" | Category
 
| width="20%" style="color:gray;" | Category
Line 14: Line 14:
 
==Quadrature Encoder component==
 
==Quadrature Encoder component==
 
Quadrature Encoder component implements a rotary encoder connected to two pins. Quadrature Encoders provides incremental positioning rather than absolute positioning.  
 
Quadrature Encoder component implements a rotary encoder connected to two pins. Quadrature Encoders provides incremental positioning rather than absolute positioning.  
 +
 +
==Component Pack==
 +
 +
MECHATRONICS
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 26: Line 32:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 83: Line 91:
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:]] -  
+
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
 
| width="90%" | Value
 
| width="90%" | Value
 
|-
 
|-
Line 176: Line 184:
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}

Revision as of 15:22, 5 January 2022

Author Matrix TSL
Version 1.5
Category General Input


Quadrature Encoder component

Quadrature Encoder component implements a rotary encoder connected to two pins. Quadrature Encoders provides incremental positioning rather than absolute positioning.

Component Pack

MECHATRONICS

Detailed description

No detailed description exists yet for this component

Examples

Polling

Example program showing how to use a quadrature encoder component using a polling method. FC6 Icon.png Quad_Encoder_Test

Timer Interrupt Based Polling

Example program showing how to use a quadrature encoder component using a polling method via a timer interrupt. FC6 Icon.png Quad_Encoder_Timer

Interrupt On Change

Example program showing how to use a quadrature encoder component using a interrupt on pin state change interrupt (IOC). FC6 Icon.png Quad_Encoder_IOC

Downloadable macro reference

Fc9-comp-macro.png CheckForChanges
Polling function to check changes Returns 1 for chaged, 0 for no change, 255 for error 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Disable
Disables the use of the quad encoder Once this ist called, the read functions will return zeros until the next Enable() call 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WriteCounter32
Sets the value of the internal count variable. Range: -2147483648 to 2147483647 
Fc9-s32-icon.png - LONG Value
Range: -2147483648 to 2147483647 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Enable
Enables the use of the quad encoder If this is not called, the read functions will return zeros 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Rotate
Simulation Rotate function to allow accurate rotation during simulation. Automatically called by any attached coupling or gearbox component. 
Fc9-f32-icon.png - FLOAT Angle
Amount to rotate the shaft input in degrees 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadCounter
Reads the current dial counter This is a counter from -32768 to 32767 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png WriteCounter
Sets the value of the internal count variable. Range: -32768 to 32767 
Fc9-s16-icon.png - INT Value
Range: -32768 to 32767 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ResetCounter
Resets the current dial counter to zero  
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadCounter32
Reads the current dial counter as a 32-bit value This is a counter from -2147483648 to 2147483647 
Fc9-s32-icon.png - LONG Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Variable Type
Selects the size of the encoder count variable depending on the number of encoder counts required to be stored. The 16 bit variable counter is accessed via the ReadCounter and WriteCounter functions. The 32 bit variable counter is accessed via the ReadCounter32 and WriteCounter32 functions. 
Fc9-type-16-icon.png Post Scaler
Encoders with a mechanical click will often have 4 transitions per click. 1:1 would provide the maximum output resolution. 1:4 would provide the encoder click count. 
Fc9-type-21-icon.png Edges Per Revolution
Number of signal transitions per revolution. E.g. for a 360 degree encoder you would likely get 360 x 4 = 1440 transitions and an accuracy of 0.25 degrees. 
Fc9-type-15-icon.png Resolution
The resolution of the encoder in degrees 
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png A
Input pin A 
Fc9-type-5-icon.png B
Input Pin B  
Fc9-conn-icon.png Simulations
Fc9-type-16-icon.png Repeat Rate
Simulated repeat rate when clicking and rotating the encoder 
Fc9-type-15-icon.png Rotation Increment
Number of degrees to rotate when performing a single quadrature pin transition. 
Fc9-type-7-icon.png Scope Traces