Custom Code: Difference between revisions
Jump to navigation
Jump to search
Created page with "Image:TArduinoCustomCode.png == Summary == Custom code component allowing direct C/C++ code integration with multiple data type support for input and output operations. == Description == The Custom Code component provides a flexible interface for embedding custom C/C++ code within visual programming environments. It supports multiple data types including analog, digital, complex arrays, images, audio, and specialized types like color and orientation data. The compo..." |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
== Summary == | == Summary == | ||
Custom | Custom Code component in '''Visuino Professional''' lets you inject arbitrary C/C++/Arduino code into your visual program. | ||
It removes limitations of built-in components and allows integration of unsupported sensors, libraries, hardware modules, or protocols — providing nearly unlimited flexibility in what can be created. | |||
== Description == | == Description == | ||
The Custom Code component | The '''Custom Code''' component is one of the most powerful features of ''Visuino Professional''. | ||
It is designed to fill gaps whenever a sensor, module, protocol, or function is not natively supported by Visuino. | |||
With this component you can embed your own C++/Arduino code to extend Visuino’s capabilities with minimal restrictions. | |||
'''Key Features:''' | |||
* Full support for external Arduino or C++ libraries, custom modules, and additional functionality. | |||
* Mechanisms for code customization: '''Defines''', '''Includes''', '''Global Declarations/Implementations''', and logic hooks ('''OnInit''', '''OnStart''', '''OnExecute''', '''OnUpdate Hardware'''). | |||
* Ability to implement any hardware communication protocol (e.g. Modbus, CANBus, MQTT, REST). | |||
* '''Live Code''' view lets you inspect and debug the generated code in real time. | |||
* Works seamlessly with professional features such as '''SubDiagrams''', industrial protocols, and device | |||
<b>Diagram:</b> | <b>Diagram:</b> | ||
Line 16: | Line 26: | ||
*'''Global Implementations''' – Global function implementations (Default: 0 items). | *'''Global Implementations''' – Global function implementations (Default: 0 items). | ||
*'''Includes''' – Header file inclusions and import statements (Default: 0 items). | *'''Includes''' – Header file inclusions and import statements (Default: 0 items). | ||
*'''Inputs''' – | *'''Inputs''' – Opens a window where you can add input pins of various data types: | ||
** Clock (digital) – timing and synchronization trigger. | |||
** Date/Time (complex) – date and time data input. | |||
** Analog Array (analog array) – array of analog values input. | |||
** Complex Array (complex array) – array of complex data structures input. | |||
** Binary (binary) – binary data input. | |||
** Color (color) – RGB color data input. | |||
** Alpha Color (alpha color) – RGBA color input with alpha channel. | |||
** RGBW Color (rgbw color) – RGBW color data input. | |||
** RGBW Alpha Color (rgbw alpha color) – RGBWA color data input with alpha channel. | |||
** Orientation 2D (orientation 2d) – 2D orientation and position input. | |||
** Orientation 3D (orientation 3d) – 3D orientation and position input. | |||
** Image (image) – image data input. | |||
** Audio (audio) – audio signal input. | |||
** CAN bus (can bus) – CAN bus communication data input. | |||
** Unsigned Array (unsigned array) – array of unsigned integers input. | |||
** Unsigned 64 (unsigned 64) – 64-bit unsigned integer input. | |||
*'''Libraries''' – External library dependencies and linkages (Default: 0 items). | *'''Libraries''' – External library dependencies and linkages (Default: 0 items). | ||
*'''Members''' – Class member variables and methods (Default: 0 items). | *'''Members''' – Class member variables and methods (Default: 0 items). | ||
Line 24: | Line 50: | ||
*'''On Start''' – Code executed at program start. | *'''On Start''' – Code executed at program start. | ||
*'''On Update Hardware''' – Code executed during hardware update cycles. | *'''On Update Hardware''' – Code executed during hardware update cycles. | ||
*'''Outputs''' – | *'''Outputs''' – Opens a window where you can add output pins of various data types: | ||
** Clock Out (digital) – processed timing signal output. | |||
** Data Out (complex) – processed data output. | |||
** Analog Array Out (analog array) – processed analog array output. | |||
** Complex Array Out (complex array) – processed complex array output. | |||
** Binary Out (binary) – processed binary data output. | |||
** Color Out (color) – processed color data output. | |||
** Alpha Color Out (alpha color) – processed alpha color output. | |||
** RGBW Color Out (rgbw color) – processed RGBW color output. | |||
** RGBW Alpha Color Out (rgbw alpha color) – processed RGBWA color output. | |||
** Orientation 2D Out (orientation 2d) – processed 2D orientation output. | |||
** Orientation 3D Out (orientation 3d) – processed 3D orientation output. | |||
** Image Out (image) – processed image output. | |||
** Audio Out (audio) – processed audio output. | |||
** CAN bus Out (can bus) – processed CAN bus data output. | |||
** Unsigned Array Out (unsigned array) – processed unsigned array output. | |||
** Unsigned 64 Out (unsigned 64) – processed 64-bit unsigned integer output. | |||
== Pins == | == Pins == | ||
*'''Clock''' (digital) – The only direct input pin. When triggered, it executes the code in the component. | |||
*'''Clock''' (digital) – | |||
* | == Resources == | ||
* | === Tutorials & Guides === | ||
* | * [https://www.instructables.com/Adafruit-MPRLS-Pressure-Sensor-Using-Visuino-Custo Adafruit MPRLS Pressure Sensor Using Visuino Custom Code] | ||
* | * [https://www.instructables.com/Control-Stepper-Motor-Nema17-How-to-Use-Custom-Cod Control Stepper Motor Nema17 – How to Use Custom Code in Visuino PRO] | ||
* | * [https://www.instructables.com/MFRC522-RFID-Reader-How-to-Use-Custom-Code-in-Visu MFRC522 RFID Reader – How to Use Custom Code in Visuino PRO] | ||
* | * [https://www.instructables.com/MAX30100-Heart-Rate-Sensor-Oximeter-How-to-Use-Cus MAX30100 Heart Rate Sensor & Oximeter – How to Use Custom Code in Visuino PRO] | ||
* | |||
* | === Video Tutorials === | ||
* | * [https://www.youtube.com/watch?v=dBBtTwn5jJw Visuino Custom Code Part 101 – OnData Element] | ||
* | * [https://youtu.be/JISPq7HfRBA Visuino Custom Code Part 102 – On Execute VS On Data Loops] | ||
* | * [https://youtu.be/DJMKRzkLddU Visuino Custom Code Part 103 – Working with and Outputting Data] | ||
* [https://youtu.be/631Yjuc8POE Visuino Custom Code Part 104 – Adding User Input and Multiple Loops] | |||
* | * [https://youtu.be/uJ5vESK6uyY Visuino Custom Code Part 105 – On Execute (System Loop)] | ||
* [https://youtu.be/nhqrB8zMRCs Visuino Custom Code Part 106 – Includes, Defines, Arrays, and Custom Library] | |||
* | * [https://youtu.be/NYJYwj1y7KM Visuino Custom Code Part 107 – Using the Clock Output Pins] | ||
* [https://youtu.be/O_BJRXq6QuM Visuino Custom Code Part 108 – Using Hardware Libraries and Pin Attachments] | |||
* [https://youtu.be/JNphV3EHzyI Visuino Custom Code Part 109 – OnInit, OnStart, and Direct Pin Manipulation/Reading] | |||
== Categories == | == Categories == |
Latest revision as of 08:40, 11 September 2025
Summary
Custom Code component in Visuino Professional lets you inject arbitrary C/C++/Arduino code into your visual program. It removes limitations of built-in components and allows integration of unsupported sensors, libraries, hardware modules, or protocols — providing nearly unlimited flexibility in what can be created.
Description
The Custom Code component is one of the most powerful features of Visuino Professional. It is designed to fill gaps whenever a sensor, module, protocol, or function is not natively supported by Visuino. With this component you can embed your own C++/Arduino code to extend Visuino’s capabilities with minimal restrictions.
Key Features:
- Full support for external Arduino or C++ libraries, custom modules, and additional functionality.
- Mechanisms for code customization: Defines, Includes, Global Declarations/Implementations, and logic hooks (OnInit, OnStart, OnExecute, OnUpdate Hardware).
- Ability to implement any hardware communication protocol (e.g. Modbus, CANBus, MQTT, REST).
- Live Code view lets you inspect and debug the generated code in real time.
- Works seamlessly with professional features such as SubDiagrams, industrial protocols, and device
Diagram:
Properties
- Defines – Preprocessor definitions and macros (Default: 0 items).
- Global Declarations – Global variable and function declarations (Default: 0 items).
- Global Implementations – Global function implementations (Default: 0 items).
- Includes – Header file inclusions and import statements (Default: 0 items).
- Inputs – Opens a window where you can add input pins of various data types:
- Clock (digital) – timing and synchronization trigger.
- Date/Time (complex) – date and time data input.
- Analog Array (analog array) – array of analog values input.
- Complex Array (complex array) – array of complex data structures input.
- Binary (binary) – binary data input.
- Color (color) – RGB color data input.
- Alpha Color (alpha color) – RGBA color input with alpha channel.
- RGBW Color (rgbw color) – RGBW color data input.
- RGBW Alpha Color (rgbw alpha color) – RGBWA color data input with alpha channel.
- Orientation 2D (orientation 2d) – 2D orientation and position input.
- Orientation 3D (orientation 3d) – 3D orientation and position input.
- Image (image) – image data input.
- Audio (audio) – audio signal input.
- CAN bus (can bus) – CAN bus communication data input.
- Unsigned Array (unsigned array) – array of unsigned integers input.
- Unsigned 64 (unsigned 64) – 64-bit unsigned integer input.
- Libraries – External library dependencies and linkages (Default: 0 items).
- Members – Class member variables and methods (Default: 0 items).
- Name – Component identifier (Default: CustomCode).
- On Execute – Code executed during main execution cycle.
- On Init – Code executed during initialization phase.
- On Start – Code executed at program start.
- On Update Hardware – Code executed during hardware update cycles.
- Outputs – Opens a window where you can add output pins of various data types:
- Clock Out (digital) – processed timing signal output.
- Data Out (complex) – processed data output.
- Analog Array Out (analog array) – processed analog array output.
- Complex Array Out (complex array) – processed complex array output.
- Binary Out (binary) – processed binary data output.
- Color Out (color) – processed color data output.
- Alpha Color Out (alpha color) – processed alpha color output.
- RGBW Color Out (rgbw color) – processed RGBW color output.
- RGBW Alpha Color Out (rgbw alpha color) – processed RGBWA color output.
- Orientation 2D Out (orientation 2d) – processed 2D orientation output.
- Orientation 3D Out (orientation 3d) – processed 3D orientation output.
- Image Out (image) – processed image output.
- Audio Out (audio) – processed audio output.
- CAN bus Out (can bus) – processed CAN bus data output.
- Unsigned Array Out (unsigned array) – processed unsigned array output.
- Unsigned 64 Out (unsigned 64) – processed 64-bit unsigned integer output.
Pins
- Clock (digital) – The only direct input pin. When triggered, it executes the code in the component.
Resources
Tutorials & Guides
- Adafruit MPRLS Pressure Sensor Using Visuino Custom Code
- Control Stepper Motor Nema17 – How to Use Custom Code in Visuino PRO
- MFRC522 RFID Reader – How to Use Custom Code in Visuino PRO
- MAX30100 Heart Rate Sensor & Oximeter – How to Use Custom Code in Visuino PRO
Video Tutorials
- Visuino Custom Code Part 101 – OnData Element
- Visuino Custom Code Part 102 – On Execute VS On Data Loops
- Visuino Custom Code Part 103 – Working with and Outputting Data
- Visuino Custom Code Part 104 – Adding User Input and Multiple Loops
- Visuino Custom Code Part 105 – On Execute (System Loop)
- Visuino Custom Code Part 106 – Includes, Defines, Arrays, and Custom Library
- Visuino Custom Code Part 107 – Using the Clock Output Pins
- Visuino Custom Code Part 108 – Using Hardware Libraries and Pin Attachments
- Visuino Custom Code Part 109 – OnInit, OnStart, and Direct Pin Manipulation/Reading
Categories
- File:Programming.png – Code and programming components.
- File:Custom.png – User-customizable components.
- File:Interface.png – Data interface and conversion components.
- File:DataProcessing.png – Data manipulation and processing components.
- File:Advanced.png – Advanced programming components.