Jump to content

Component: Quadrature Encoder (EBM007) (EBM Modules)

From Flowcode Help
Revision as of 09:56, 27 January 2023 by Wiki bot (talk | contribs)
Author Matrix TSL
Version 1.0
Category EBM Modules


Quadrature Encoder component

Provides a rotary encoder with dual digital outputs that provide rotation and direction information. When connected to two digital inputs of a microcontroller a “digital pot” can be implemented to convert to digital values.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_EBM007v2.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_EBM007v2.fcfx

Detailed description

No detailed description exists yet for this component

Examples

This example scans the encoder for changes and displays a counter on the LCD based on the movement of the encoder.

EBM007 Example


Macro reference

CheckForChanges
Polling function to check changes Returns 1 for chaged, 0 for no change, 255 for error 
- BYTE Return


Disable
Disables the use of the quad encoder Once this ist called, the read functions will return zeros until the next Enable() call 
- VOID Return


WriteCounter32
Sets the value of the internal count variable. Range: -2147483648 to 2147483647 
- LONG Value
Range: -2147483648 to 2147483647 
- VOID Return


Enable
Enables the use of the quad encoder If this is not called, the read functions will return zeros 
- VOID Return


ReadCounter
Reads the current dial counter This is a counter from -32768 to 32767 
- INT Return


WriteCounter
Sets the value of the internal count variable. Range: -32768 to 32767 
- INT Value
Range: -32768 to 32767 
- VOID Return


ResetCounter
Resets the current dial counter to zero  
- VOID Return


ReadCounter32
Reads the current dial counter as a 32-bit value This is a counter from -2147483648 to 2147483647 
- LONG Return



Property reference

Properties
Count Variable
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. 
Encoder Resolution
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. 
Connections
A
Input pin A 
B
Input Pin B  
Simulation
Repeat Rate
Simulated repeat rate when clicking and rotating the encoder 
Rotation Increment
Number of degrees to rotate when performing a single quadrature pin transition. 
Scope Traces
 

==Macro reference==

CheckForChanges
Polling function to check changes Returns 1 for chaged, 0 for no change, 255 for error 
- BYTE Return


Disable
Disables the use of the quad encoder Once this ist called, the read functions will return zeros until the next Enable() call 
- VOID Return


WriteCounter32
Sets the value of the internal count variable. Range: -2147483648 to 2147483647 
- LONG Value
Range: -2147483648 to 2147483647 
- VOID Return


Enable
Enables the use of the quad encoder If this is not called, the read functions will return zeros 
- VOID Return


ReadCounter
Reads the current dial counter This is a counter from -32768 to 32767 
- INT Return


WriteCounter
Sets the value of the internal count variable. Range: -32768 to 32767 
- INT Value
Range: -32768 to 32767 
- VOID Return


ResetCounter
Resets the current dial counter to zero  
- VOID Return


ReadCounter32
Reads the current dial counter as a 32-bit value This is a counter from -2147483648 to 2147483647 
- LONG Return



Property reference

Properties
Count Variable
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. 
Encoder Resolution
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. 
Connections
A
Input pin A 
B
Input Pin B  
Simulation
Repeat Rate
Simulated repeat rate when clicking and rotating the encoder 
Rotation Increment
Number of degrees to rotate when performing a single quadrature pin transition. 
Scope Traces
 

==Macro reference==

CheckForChanges
Polling function to check changes Returns 1 for chaged, 0 for no change, 255 for error 
- BYTE Return


Disable
Disables the use of the quad encoder Once this ist called, the read functions will return zeros until the next Enable() call 
- VOID Return


WriteCounter32
Sets the value of the internal count variable. Range: -2147483648 to 2147483647 
- LONG Value
Range: -2147483648 to 2147483647 
- VOID Return


Enable
Enables the use of the quad encoder If this is not called, the read functions will return zeros 
- VOID Return


ReadCounter
Reads the current dial counter This is a counter from -32768 to 32767 
- INT Return


WriteCounter
Sets the value of the internal count variable. Range: -32768 to 32767 
- INT Value
Range: -32768 to 32767 
- VOID Return


ResetCounter
Resets the current dial counter to zero  
- VOID Return


ReadCounter32
Reads the current dial counter as a 32-bit value This is a counter from -2147483648 to 2147483647 
- LONG Return



Property reference

Properties
Count Variable
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. 
Encoder Resolution
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. 
Connections
A
Input pin A 
B
Input Pin B  
Simulation
Repeat Rate
Simulated repeat rate when clicking and rotating the encoder 
Rotation Increment
Number of degrees to rotate when performing a single quadrature pin transition. 
Scope Traces
 

==Macro reference==

CheckForChanges
Polling function to check changes Returns 1 for chaged, 0 for no change, 255 for error 
- BYTE Return


Disable
Disables the use of the quad encoder Once this ist called, the read functions will return zeros until the next Enable() call 
- VOID Return


WriteCounter32
Sets the value of the internal count variable. Range: -2147483648 to 2147483647 
- LONG Value
Range: -2147483648 to 2147483647 
- VOID Return


Enable
Enables the use of the quad encoder If this is not called, the read functions will return zeros 
- VOID Return


ReadCounter
Reads the current dial counter This is a counter from -32768 to 32767 
- INT Return


WriteCounter
Sets the value of the internal count variable. Range: -32768 to 32767 
- INT Value
Range: -32768 to 32767 
- VOID Return


ResetCounter
Resets the current dial counter to zero  
- VOID Return


ReadCounter32
Reads the current dial counter as a 32-bit value This is a counter from -2147483648 to 2147483647 
- LONG Return



Property reference

Properties
Count Variable
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. 
Encoder Resolution
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. 
Connections
A
Input pin A 
B
Input Pin B  
Simulation
Repeat Rate
Simulated repeat rate when clicking and rotating the encoder 
Rotation Increment
Number of degrees to rotate when performing a single quadrature pin transition. 
Scope Traces