Dataguess
v0.3.0
v0.3.0
  • Welcome
  • Getting Started
    • Installation
      • Windows Installation
      • Linux Installation
    • Activation
  • REFERENCES
    • Workstation
    • Workgroup
    • Dataflow
    • Components
      • Core Concepts
        • Scheduler
        • Synchronizing Ports
        • Import / Export Ports
        • Forwarding Inputs
      • Inputs
        • MQTT
        • Modbus TCP
        • Siemens S7
        • OPC UA
        • TwinCAT
        • EtherNet/IP
        • Camera
      • Outputs
        • MQTT
        • Modbus TCP
        • Siemens S7
        • CSV
        • JSON
        • InfluxDB
        • OPC UA
        • TwinCAT
        • Data Watch
        • FTP Client
        • Image Stream
      • Function
        • Math & Logic
        • Array Functions
        • Image Functions
        • Type Conversion
        • To JSON
        • From JSON
        • Array
        • Timer
      • API
        • HTTP
      • Server
        • HTTP Server
      • Script
        • Python Script Editor
      • Ai
        • ONNX
        • Scikit Learn
  • Use Cases
  • FAQ
Powered by GitBook
On this page
  • Node Definitions
  • Input Ports
  • Output Ports
  • Rule Editor
  • Working Example

Was this helpful?

  1. REFERENCES
  2. Components
  3. Script

Python Script Editor

Python language based Script Editor

PreviousScriptNextAi

Last updated 3 years ago

Was this helpful?

Node Definitions

Python Script Editor has no unique node definition to be configured, you can give it a name and a description:

Input Ports

Output Ports

Rule Editor

Rule Editor has two sections. On the left-hand side you can see your Input & Output ports with their id written and a copy button.

Input ports will copy getInputValueById(that-ports-id) which you can use in your code section to get that input port's value.

Output ports will copy setOutputValueById(that-ports-id, value)which you can use in your code to set that output port's value.

In your code section in the Rule Editor you can use python libraries by importing them (e.g. from random import randint).

Working Example

You can define input ports to the Python Script Editor, and use these inputs' value in your with the function getInputValueById

Your output port values are set in your with the function setOutputValueById When you define your input and output ports, each of those will have unique IDs and will be visible in your Rule Editor page.

This is a python script, therefore adhere to the indentation rules, otherwise script will not run as expected.

⚠️
Rule Editor
Rule Editor
Node Definitions
Python Script Editor Input Ports
Python Script Editor Output Ports
Rule Editor ports section
Rule Editor script
Python Script Editor working example