-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Devices, Transformers, APIs, and Runtime Concepts
Flexxbotics is built around Devices and Transformers, with supporting concepts such as extensions, protocols, scripts, and adapters. Together, these components enable communication with equipment, runtime execution, visualization, and autonomous control.
All of these entities are editable via the Studio development environment.
Accessing Studio in Flexx Edge:
- Top right menu → Devices & Transformers → Studio tab
A Device is the top-level runtime object created from the Devices screen in the Flexxbotics UI. Devices represent physical or logical equipment, including:
- Robots
- PLCs
- Machines
- Safety systems
- Cameras
- Inspection systems
- Workcells
Devices are created based on Machine Model options.
Machine models determine:
- Equipment OEM
- Equipment model
- Controller type
- Which Transformer is used for communication
Machine models are defined in JSON files located in the models folder of a transformer.
Each machine model JSON specifies:
- OEM
- Equipment model
- Controller
- The transformer responsible for communicating with the equipment
Machine models act as the configuration layer that binds physical equipment to a specific transformer implementation.
A Transformer is the software component responsible for communicating with equipment.
Each transformer has a JSON definition that includes:
- Metadata for the transformer
- The Python file name
- The Python class name
When a device is created, an instance of its transformer is:
- Assigned to the device
- Instantiated in the runtime environment
Transformer methods become execution points for:
- Status reads
- Variable reads/writes
- Commands
- Polling logic
- And more
Extensions are external software components that run outside the Flexxbotics runtime.
Common characteristics:
- Installed directly on:
- Equipment controllers
- PCs controlling the equipment
- Often implemented as servers
- Translate native equipment data into the Flexxbotics API when needed
Extensions are commonly used when:
- Native equipment protocols are only accessible via OEM SDKs and APIs
- Highly specific functionality is required (e.g., file manipulation, TCP clients)
Machine layouts are defined in Flexx Control.
- Equipment placed in a layout can be assigned a device
- Enables visualization of device status
- Links runtime devices to physical cell layouts
- Used primarily for monitoring and UI representation
Only one device should be marked as the Primary Device.
The primary device:
- Represents the main controller of a workcell
- Drives status events
- Determines overall workcell status
A Workcell Transformer is a generic transformer used to coordinate multiple devices.
- It can communicate with all other transformers that are defined and instantiated in the runtime.
Example:
A workcell transformer may query both a robot and a safety PLC, combine their states, and determine the overall cell status.
- Generated only by the primary device
- Appear in the Events tab on the Analytics page
- Used for workcell-level monitoring and analytics
Monitoring allows a device to be polled at a fixed interval.
Typical usage:
- Only one device is polled
- Usually the primary device
On each poll interval, the following transformer methods are called:
_read_interval_data_read_status
- Automated data collection
- Closed-loop control
- Status reconciliation
- Autonomous logic execution
Use a workcell transformer for polling logic so:
- All cell-level logic resides in one place
- Other transformers remain simple connectors
Protocols are reusable Python components used inside transformers to communicate with equipment.
Most protocols implement four core methods:
connectdisconnectsend-
receive(automatically invoked bysend)
Protocols abstract low-level communication details and enable consistent transformer implementations.
The Device API allows developers to directly interact with devices and test transformer logic.
Base URL:
<http://flexxcore.app.local:7081/api/v2e/devices/>
API Browser:
<http://flexxcore.app.local:7081/api#/>
Each endpoint maps directly to a transformer method.
| API Endpoint | Transformer Method |
|---|---|
GET /api/v2e/devices/{device_id}/status |
_read_status |
GET /api/v2e/devices/{device_id}/variables/{variable_name} |
_read_variable |
PATCH /api/v2e/devices/{device_id}/variables/{variable_name} |
_write_variable |
GET /api/v2e/devices/{device_id}/parameters/{parameter_name} |
_read_parameter |
PATCH /api/v2e/devices/{device_id}/parameters/{parameter_name} |
_write_parameter |
POST /api/v2e/devices/{device_id}/execute_command/{command_name} |
execute_command_v2 |
- Acts as a generic catch-all command endpoint
- Logic is implemented inside
execute_command_v2 - Uses:
-
command_nameto select behavior -
args(JSON payload) to pass parameters
-
To retrieve all devices and their metadata:
GET /api/v2e/devices
Any system with REST capabilities can communicate directly with the Device API.
For devices without REST support, Adapters are used.
- Translates TCP socket communication into REST
- Runs in a Docker container on port
7082 - Always available by default
TCP Adapter Message Format
{
"type": "GET | PATCH | POST",
"endpoint": "/api/v2e/devices/{device_id}/status",
"body": {}
}- OPC-UA
- Ethernet
Pre-written integrations are available for:
- Universal Robots (URCap)
- FANUC (KAREL)
These reside in their respective transformer directories and use the adapter pattern.
Scripts are Python files executed inside the Flexxbotics runtime to perform higher-level tasks.
- Custom operator workflows
- Autonomous control loops
- Closed-loop device coordination
- Data-driven automation
Scripts are launched via HMI controls and configured through the Advanced tab.
Scripts typically include:
- FlexxCoreClient – API client for interacting with Flexxbotics
- FlexxGUI – UI framework for building custom operator interfaces
- Main Script Class – Main process logic and control flow
- Scripts run in a Script Executor Queue
- Only one script can run at a time
Continuous applications must:
- Encapsulate all logic in a single script
- Manage loops and UI prompts internally
Example:
The APC demo runs a continuous background loop and occasionally prompts operators through the Flexx GUI.
- Use workcell transformers for cell-level logic monitoring
- Keep individual device transformers as thin connectors
- Poll only the primary device
- Centralize autonomous logic in:
- Workcell transformers
- Scripts (when UI or orchestration is required)