Skip to content

EventCounter_versatile1

pierre drezet edited this page Aug 20, 2025 · 3 revisions
EventCounterVersatile Misc ↓ Params ↓ Ports ↓

This component is used to count events and present the count at the data output [Out]cnt. This is a more versatile version of the basic counter and can be incremented when the input event [In]inc is asserted or decremented when the input event [In]dec is asserted. A maximum and minimum threshold can be set by specifying the parameters Max. Threshold and Min. Threshold or by overriding the parameters by presenting values to the data inputs [In]max and [In]min respectively. Note that if a value of 0 is used for the Max. Threshold parameter then the Max. Threshold is set to 2147483647, which is the maximum permissible value.

An initial value for the count can be set by presenting a value to the data input [In]ini, if the port is not connected the Initial Value parameter value is used. Similarly a step size for each increment or decrement event can be set by presenting a value to the data input [In]step, if the port is not connected the Step Size parameter value is used. Note that the minimum step size is 1.

The [In]enable and [In]disable event inputs can be used to enable and disable the counter, meaning that the count will be incremented or decremented if and only if the counter is enabled. The [In]rst event input is used to reset the count to its initial value.

If the count exceeds the upper threshold then the overflow output event [Out]ovf is triggered, similarly if the count exceeds the lower threshold then the overflow output event [Out]ovf is triggered. If and only if the count does not exceed the thresholds when an increment or decrement event is asserted, then the corresponding output event will be triggered and the count value will be presented to the data output [Out]cnt.

The count will always be inside the bounds of the minimum and maximum thresholds. For example if the initial value is set to be greater than the maximum threshold, then the initial value will be capped at the maximum threshold, the same holds true for an initial value that is less than the minimum threshold.

At each increment, the count is only incremented if the sum of count value and the step size is less than or equal to the maximum threshold. The same rule applies to decrement events with respect to the minimum threshold. For example if the step size is 3, the count is 8 and the maximum threshold is 10, then on the next increment event the count will remain on 8 and the output event [Out]ovf will be triggered. If the step size is 2, the count is 8 and the maximum threshold is 10, then on the next increment event the count will incremented to 10 and the input event [In]inc will be triggered and a value of 10 presented to the data output [Out]cnt.

If the values presented to either of the data inputs [In]max or [In]min change then the new thresholds will be used on the next increment, decrement or reset events. If the value of the counter is greater than the new maximum threshold then the counter will be set to the maximum threshold and similarly if the the counter is less than the new minimum threshold then the counter will be set to the minimum threshold. Note that the counter value is changed to be within the new thresholds before the increment or decrement of its value. For example when the input event [In]inc is triggerred, if the counter value is below the new minimum threshold it will be set to the new minimum threshold and before its value is incremented and presented to the data output [Out]cnt.

name type default min. max. description
Enable at Init Boolean 1

Enable the counter at initialisation time if TRUE, else counter is disabled at initialisation time.
Initial Value Integer 0 -2147483648 2147483647 Initial Value for count.
Step Size Integer 1 1 2147483647 Value incremented/decremented on each count.
Max. Threshold Integer 1000 -2147483648 2147483647 Threshold value for ovf event.
Min. Threshold Integer 0 -2147483648 2147483647 Threshold value for ovf event.
hreshold.
In Ev.
rstc Input event, resets the count to its intial value.
inc Input event, triggers an increment of the counter and presents the count to the data output [Out]cnt
dec Input event, triggers an decrement of the counter and presents the count to the data output [Out]cnt.
enable Input event, the counter will register increment or decrement events after this event is triggered.
disable Input event, the counter will not register increment or decrement events after this event is triggered.
Data In
ini Data input, the initial value for the counter. Overrides the parameter Initial Value.
step Data input, the value by which the count is incremented or decremented by. Overrides the parameter Step Size.
max Data input, the maximum threshold for the counter. Overrides the parameter Max. Threshold.
min Data input, the minimum threshold for the counter. Overrides the parameter Min. Threshold.
Data Out
cnt Data output, the current count.
Out Ev.
Output event, is asserted if and only if an increment event is received and the count is less than the maximum threshold.
Output event, is asserted if and only if a decrement event is received and the count is greater than the minimum threshold.
Output event, is asserted if and only if a decrement event is received and the count is greater than the minimum threshold.
Output event.
Output event.
Output event.
ovf Output event, is asserted if and only if an increment event is received and the count is equal to or greater than the maximum threshold.
inc Asserted if and only if an increment event is received and the count is less than the maximum threshold.
State Machine None

Toolbox Core Version v1.0.
Licence Type MPL2.0 Component Supplier inx ltd.
Minumum DCC A0000 Profiles All.

Core Components

Events & Triggers

State Management

  • STATE - Represents a State in Lucid
  • state_condition - Event driven state condition --> transition and actions
  • state_debug - To debug state machines this function block is required.
  • state_manager - Each state machine is defined by a State Manager

Array & Data Structures

Buffers & Queues

Primitive Data Constants

Data Converters

Boolean Logic



Mathematics

Alebraic Evaluation

Mathematical Operators

Inequalities

Trigonometry

Other Functions

Data Selection

  • indexed_mux_int - Indexed Mux Int
  • indexed_mux_str - Indexed Mux String
  • map_int - Map Int
  • mux_1b - mux_1b
  • mux_1i - mux_1i
  • mux_1r - mux_1r
  • mux_1s - mux_1s
  • mux_2b - MultiplexTwo Input Bool
  • mux_2i - MultiplexTwo Input Int
  • mux_2r - MultiplexTwo Input Real
  • mux_2s - MultiplexTwo Input String
  • mux_3b - MultiplexThree Input Bool
  • mux_3i - MultiplexThree Input Int
  • mux_3r - MultiplexThree Input Real
  • mux_3s - MultiplexThree Input String
  • mux_4b - MultiplexFour Input Bool
  • mux_4i - MultiplexFour Input Int
  • mux_4r - MultiplexFour Input Real
  • mux_4s - MultiplexFour Input String
  • mux_8b - 8-Input Indexed Boolean Multiplexer Function Block
  • mux_8i - 8-Input Indexed Integer Multiplexer Function Block
  • mux_8r - 8-Input Real Number Multiplexer Function Block
  • mux_8s - Number Multiplexer Function Block
  • num_mux - Numeric Multiplexer Function Block

Data Processing & Parsers

Database & Storage

Demultiplexers

String Functions

File Operations



Basic IO Components

GPIO & Hardware I/O



Graphics and UI Components

GUI & User Interface

User Input

  • keypress - Reads key presses & control keys

Unity & Web Integration

  • inx-unity - Provides media and animation widget interface
  • unity2 - Unity 3D
  • webkit - JavaScript/WebKit Interface (Obsolete)

Language & Localization



Media Components

Audio & Media

Digital TV & Media Control



Communications Components

TCPIP Network & Communication

Wireless & LPWAN Networks

Fieldbus Comms



Digital Signal Processing

  • ADC Polled Analogue to Digital converter.
  • ADC_continuous Advanced ADC supporting clocked ISR modes and advanced signal averaging.
  • FFT8 Fast Fourier Transform of 8 bit binary input data
  • FIR8 Finite Impulse Response filter for 8 bit binary data.
  • IIR8 Infinite Impulse Response filter for 8 bit binary data.
  • [calibrate](ADC calibrate) - Calibrates the ADCs


Control Systems Components

PID Controllers



Machine Learning & Machine Vision

  • mv_camera - Provides access to camera input data image streams
  • mv_idsplay - Renders camera image streams.
  • mv_resize - Resizes an image using given interpolation method
  • mv_crop - Crops and image width and height at a give offset
  • mv_apriltag_reader Plain Old Prgramming AprilTag Reader
  • ml_tflite_inference Machine learning model inference.
  • ml_osvm Online iterative machine learning (training& inference).


Platform Components

System Utilities

  • reboot - Reboot the device
  • rtc - RealTimeClock - provdes date/time from RTC device or OS.
  • rtinfo - RuntimeInfo (e.g. MAC/IP address, memory,... )
  • scheduler - Weekly Scheduler
  • system_exec - Executes linux shell commands
  • rng - Random Number Generator (may use hardware RNG)

Time Components

Application Management

Over the Air Update (OTA)

  • ota - OTA Function Block for updating firmware
  • ota_data_parser - Assembles OTA data files from Devman.


Non-functional Components

Some function blocks that can be used Lucid app are for visual/organisation purposes only and do not translate into any executable ert-components.

Sub System Input/Output Ports

-Note this file is autogenerated from ert-config help files and may not currently be complete or properly categorised!

Clone this wiki locally