Getting Started
1.Introduction
The DeviceSupervisor Agent (hereinafter referred to as DSA) is a data acquisition and cloud software that runs on gateways, offering users convenient data collection, data processing, Data on the cloud, and protocol conversion functionalities. It supports a variety of industrial protocols such as Modbus, ISO on TCP, EtherNet/IP, as well as power protocols like DNP3, IEC 60870, and IEC 61850.
Version 1.2.X of DSA is referred to as DSA 1.0, version 2.X.X is referred to as DSA 2.0, and version 3.X.X is referred to as DSA 3.0. This manual takes collecting PLC data and uploading it to EMQX's online MQTT server as an example to explain how DSA 3.0 implements PLC data collection and data uploading to the cloud through DSA.
The overall process is shown in the figure below:
1.1 Preparation of hardware equipment and its data collection environment
1.1.1 Hardware Wiring
1.1.1.1 Serial/Ethernet Wiring
Power on the gateway and connect the IG
gateway and PLC according to the topology using an Ethernet/serial cable. (The
topology diagram of the EC series and the IG series is the same, taking IG502
as an example)
IG502 serial port terminal wiring instructions
are as follows:
1.1.2 Set up InGateway to access PLC
For details about the default IP address of
the InGateway network port, see the IP address information on the nameplate. In
order for the InGateway to access the Ethernet PLC through the network port,
the network port must be in the same network segment as the PLC.
1.1.3 Configure InGateway for network connectivity.
For information on the latest software
releases and features of InGateway products, please visit the Resource Certer
1.3.3.1 EC Series
When using DSA, the firmware version should
be 'V2.0.10' or later for the EC942 and 'V2.0.1' or later for the EC312
Update the firmware version as shown in the
figure (the firmware version will take effect after the firmware version is
restarted):
1.3.3.2 IG Series
When using DSA, the SDK version should be
py3sdk-V1.4.5 or later. Please refer to the table for the minimum firmware
version requirements:
IG Series
|
The firmware version number of the lowest
legacy naming convention
|
The firmware version number of the
minimum new version of the naming convention
|
IG974
|
V2.0.0.r14106
|
V2.0.3
|
IG902
|
V2.0.0.r14047
|
V2.0.3
|
IG532
|
V2.0.0.r14238
|
V2.0.1
|
IG504
|
无
|
V2.0.5
|
IG502
|
V2.0.0.r14045
|
V2.0.5
|
Update the
firmware version as shown in the image:Update the SDK as
shown in the image:
2.Install and manage DSA
2.1 Install and run DSA
2.1.1 EC series
2.1.1.1 Installation and Running of Python App
To install and run Python App (hereinafter referred to as App) in the EC series, please refer to the following process:
Click the "Add" button and select the App package file to be installed, and then click Confirm.
After a successful import, you can view the imported App as shown in the following diagram:
2.1.1.2 Update Python App Runtime Configuration
If the installed App supports modifying the runtime
method by importing a configuration file, you can follow the process below to
update the App's runtime configuration:
After a successful import, it will run
according to the imported configuration file.
2.1.1.3 Update the version of Python App
Usually, if you need to update the version of the Python App, you only need to import the new version of the App on the following page.
After the update is completed, it will appear as shown below:
2.1.1.4 View/Download Logs
View/download the logs during the running
of the App in the interface as shown:
After selecting the log level in
"Level", logs lower than this level will not be displayed and saved.
Log level sorting: ERROR>WARN>INFO>DEBUG>All.
To download the log, click the
"Download" button.
2.1.2 IG Series
2.1.2.1 Installation and Running of Python App
To install and run a Python App (hereinafter referred to as the App) on the IG series, please refer to the following process:
Before installing the App, ensure that the Python SDK is installed and the Python edge computing engine is enabled, as shown in the diagram below:
Click the "Add" button and select the App package file you need to install, then click confirm.
After a successful import, you can view the imported App as shown in the diagram below:
Check the enable box to run the App.
Once enabled, the App will run on IG series products and automatically run every time the device is powered on.
2.1.2.2 Update Python App Runtime Configuration
If the installed App supports modifying the running method by importing a configuration file, click the "Import Configuration" button and select the configuration file you need to import, then click confirm.
After a successful import, restart the App, and once restarted, it will run according to the imported configuration file.
2.1.2.3 Update the version of Python App
To update the version of a Python App, you typically only need to import the new version of the App.
After the update is completed, the interface will appear as shown in the diagram below:
2.1.2.4 View/Download Logs
View/download the logs during the running of the App in the interface as shown:
After setting the log level, logs higher than this level will be displayed and saved. The log level is set in the Parameter Settings interface, and the log level is sorted: ERROR>WARN>INFO>DEBUG
3. Quick start
This tutorial takes the Modbus TCP protocol as an example to introduce a simple example of how DSA can quickly start collecting device data and upload the data to the EMQX MQTT public cloud service, as well as receive MQTT messages and write values.
3.1 Enable Modbus Simulator
The tutorial uses ModRSsim2 as the Modbus TCP Slave. Run the ModRSsim2.exe software and configure the port number as shown in the diagram:
After running device_supervisor, add a southbound controller. In the controller protocol, select the Modbus TCP protocol and configure the relevant parameters.
- Name: Controller name, for example: Modbus TCP
- Controller Protocol: Select Modbus TCP
- IP Address: Fill in the IP address of the PC where the Modbus simulator is installed;
- Port Number: Default port 502;
- Slave Address: Default is sufficient.
3.3 Add Measuring Point
In the list of measuring points, add the device measuring points needed for collection and configure the measuring point's name, address, data type, etc., as shown in the diagram below:
Once configured, click “Confirm” to add the measuring points. After creating the measuring points, wait a few seconds; if the controller connection status is still disconnected, perform the following actions to find the reason:
- Check if the IP and port were entered correctly when creating the controller.
- Check if the gateway can access the IP and port of the simulator.
Enable the MQTT cloud service and configure the server address, MQTT client ID, port number, and other parameters as shown in the diagram:
- Server Address: MQTT server address, for example, EMQX MQTT public cloud server address broker.emqx.io
- Client ID: Custom client ID, which is the unique identifier for connecting to the server.
- Port Number: MQTT server port number, for example, EMQX MQTT public cloud server port 1883
Once configured, click submit and wait a few seconds. The MQTT connection status should be visible in the status bar as connected successfully. If it constantly shows as connecting, perform the following actions to find the reason:
- Check if the device can access the Internet;
- Check if the server address and port and other configuration information are correct.
If the connection drops after a while, check if the MQTT client ID has been used, or consider changing the client ID.
After the MQTT connection is successful, add a publishing script as shown below:
- Name: Custom publishing script name
- Trigger Source Type: For example, select "Measuring Point Group"
- Group/Label: Select the group where the measuring point is located. The example uses the default group.
- Topic: Publish topic, the example uses inhand_pub
- Qos(MQTT): supports 0, 1, 2
- QuickFunction: Just use the default
As shown in the figure below, add a subscription script:
- Name: Custom publishing script name
- Topic: Publish topic, the example uses inhand_pub
- Qos(MQTT): supports 1
- Payload type: Select Plaintext in the tutorial
- QuickFunction:
# Enter your python code.
import json
from common.Logger import logger
from quickfaas.measure import write_plc_values
def write_callback(message, userdata):
logger.debug("write plc response: %s,
userdata:%s" % (message, userdata))
def main(topic, payload, cloudName):
logger.debug("subscribe topic: %s, payload: %s, cloudName: %s"
% (topic, payload, cloudName))
write_plc_values(message=json.loads(payload), callback=write_callback,
userdata="")
3.6View data/write values on EMQX public cloud client
The tutorial uses the client tool provided by the EMQX official website to connect to the public EMQX broker to view the data uploaded by the gateway to the MQTT Broker.
On the EMQX official website (https://www.emqx.com/zh/mqtt/public-mqtt5-broker), choose to use the MQTT client tool online for testing
Click "New Connection" in the pop-up window that opens. After filling in the Name field in the pop-up interface, the rest of the configuration does not need to be modified. Finally, click "Connect".
In the MQTT client, write the value of the simulator collected by the gateway, as shown in the following figure, modify the value of the measurement point "WORD" collected by the gateway to 10, Paylaod:{"WORD": 10}
4. Concept
DSA Internal System Overview Block Diagram
- Controller:The controller refers to the component on the gateway page that enables and manages various collection protocols.
- (Southbound) Driver:The (southbound) driver refers to the software program in the gateway that communicates with PLC devices. It is usually developed specifically for certain manufacturers or device types and communicates using the device manufacturer's management protocols or APIs, such as Modbus, OPC, etc.
- Measuring Point:A measuring point refers to a collection point for PLC devices configured on the gateway.
- Grouping:Grouping refers to dividing measuring point data or alarm items into different groups within the gateway according to different needs and application scenarios for easier management.
- Protocol Conversion:Protocol conversion refers to forwarding data collected from the southbound direction through other protocols.
- Event Bus:The event bus refers to the message channel used for communication between various services within the gateway using MQTT messages.
- Data Preprocessing: Divided into alarms and data transformation.
- Alarm:An alarm refers to the configuration of alarm conditions for collected data within the gateway, which triggers an alarm when activated.
- Data Transformation:Data transformation refers to configuring data calculations and mapping values for collected data within the gateway.
- QuickFunction:QuickFunction refers to script functions configured within the gateway.
- Historical Database:Cache of historical data collected at measuring points
Functional characteristics
1. Measuring point monitoring
1.1 Monitoring list
In the "Monitoring List" interface, you can add controllers and measuring points to collect PLC data, and view the status and configuration information of the controller as well as data collection information.
On the current page, the controller can be edited, copied, deleted, etc.; the measuring points can be added, imported, exported, deleted, etc.
The page display of the monitoring list is as shown in the figure:
1.1.1 Add/Edit Controller
Click the "Add"/"Edit" button, select the controller protocol, such as Modbus RTU, and configure the controller's slave address, communication method, polling cycle and other parameters on the add controller page. Note: Controller names cannot be repeated.
In the advanced settings, the controller's message processing can be configured. For example, in the advanced settings of the Modbus RTU controller, parameters such as byte order, timeout time, and communication time can be configured.
1.1.2 Copy Controller
In industrial settings, there are often many similar PLC configuration parameters and measuring point configurations. To achieve rapid configuration, we have introduced the "Copy Controller" function. This feature allows us to quickly add controllers and measurement point configurations with similar settings, avoiding repetitive configuration tasks. Click on the "..." in the top right corner of the controller card to display more controller actions, then click "Copy". After configuring one controller, you can quickly add a second one; the copy controller will duplicate all the measurement points under the controller.
After clicking the "Copy" button, you can modify the differing configurations as needed, such as the controller name, slave address, etc., and then submit.
Upon completion of the copy, as shown in the diagram, the system will automatically generate measurement points and controller information identical to the first controller:
1.1.3 Disable/Enable Controller
When collecting data from multiple PLC devices and the gateway controller status or collected data is abnormal, we enable only the problematic controller for easy log viewing and real-time communication packet inspection. Click on the "..." in the top right corner of the controller card to display more controller actions, and select "Disable". After that, the controller will no longer perform data collection and reporting.
After disabling, the controller card will turn gray, as shown in the diagram.
When you want to re-enable the controller, click on the "..." in the top right corner of the controller card and select "Enable". The controller will then resume data collection and reporting.
1.1.4 Real-Time Communication Messages
When the controller status displays as abnormal or there is abnormal data collection, viewing the real-time communication messages between the gateway controller and the PLC devices becomes crucial. DSA supports displaying channel real-time communication messages. Select a controller at will, click "..." in the upper right corner of the controller card, and click "Real-time Communication Messages" to display all communication message interactions of the current channel.For example, if two Modbus RTU protocol controllers are enabled and both use an RS485 communication port, the real-time communication messages will show the communication messages of both controllers.
The display effect of real-time communication messages is as follows (Note: If you need to download communication messages, you need to enable "Store Communication Messages" in the advanced settings of the controller configuration before the "Download" button will be displayed. Communication messages of all controllers The text is displayed and saved in HEX format):
1.1.5 Add Measuring Point
In the "Measuring Point List," you can add measuring points to collect data from PLC devices. Click the "Add" button, and in the pop-up box, configure the measuring point parameters, such as adding a measurement point under a Modbus RTU protocol controller and configuring the measurement point name, address, data type, etc. (Note: The measurement point name must be unique within its controller).
In the "Measuring Point List," the "Import" button allows you to import the measurement points from a CSV file into the current gateway; the "Export" button enables you to export the current gateway's measurement point configurations to a CSV file. For details on the specific measurement point CSV file, refer to the Measuring Point CSV File Parameter Description.
1.2 Group
Group allows you to manage measuring points in the monitoring list by dividing them into groups. After the measuring points are grouped, the storage of historical data and measuring point reporting intervals are managed according to the configured groups. If you need to configure different reporting intervals for the measuring points or need to report corresponding data of the measuring points according to different MQTT topics, you can add a new group to manage the measuring points with different requirements. (Note: The default group cannot be deleted)
The group interface is shown in the figure:
For specific group CSV files, please refer to the Grouping CSV File Parameter Description
Add a new group on the group page. The interface is as follows:
Add group parameters Introduction:
- Name: Group name
- Reporting Interval: the reporting interval of the measuring point in the group.
- Periodically Upload Onchange Data :When enabled, Onchange data with unchanged values will also upload data according to the Onchange reporting cycle. The default is off.
- Onchange Reporting Interval: A fixed reporting interval for Onchange data.
Historical Data is a data storage function provided by DSA. DSA can create data tables for measuring point groups and insert the grouped data into the database according to the specified storage strategy. It can be configured by the following parameters:
- Max Number: The maximum number of historical data stored in a single group.
- Storage policy: Storage interval of historical data
- Same AS the Reporting Interval: Store historical data according to reporting interval.
- Independent Storage Interval: customize the storage interval of historical data.
- Storage Method: The storage method of historical data. Switching the storage path will clear the stored historical data
- Gateway Storage: Historical data is stored in the storage space of the gateway itself.
- USB: Historical data is stored in a USB storage space external to the gateway.
- SD Card: Historical data is stored in the SD card storage space external to the gateway.
After adding a group, when adding a measuring point, you can choose to associate the measuring point with the group or select the measuring point in the list of measuring points to add to the specified group. The measuring points in the group will report data according to the reporting interval of the group.
Click "Export Historical Data" to export the group's historical data in CSV format
Click "Clear Historical Data" to clear the historical data stored in this group.
1.3 Historical Database
The historical database is used to store the historical data of the measuring points. After enabling the "Store Historical Data" function in the configuration of the measuring points, the data of the measuring points can be stored in the historical database. The historical data of measuring points is stored according to the groups they belong to. This arrangement makes it more convenient to locate and export historical data for specific measuring points.
2. Alarm
2.1 Real-time Alarms
After configuring alarm rules and when alarms are triggered, the real-time alarm page will display all triggered alarm items.
In the real-time alarm table, some parameters from the alarm configuration, such as "Name," "Controller," "Alarm Level," etc., will be shown.
- Status: The current trigger status of the alarm item, displayed as "Triggered"
- Value: The value at the moment the alarm was triggered
- Time: The time when the alarm was triggered
- Action: An option to navigate to the "Historical Alarms" page for more details
Below is an example of a real-time alarm display interface.
2.2 Alarm Rules
Alarm rules can help us monitor the value of measuring points on the gateway side, and remind us in time when it exceeds the normal range. For example, in industrial scenarios, the range of voltage and current values and the start and stop status of some equipment need to be focused on. When we configure the alarm rules for collecting these data measuring points on the gateway side, if an alarm is triggered, the MQTT cloud service can be used to report the notification in time to avoid unnecessary losses.
On the alarm rules page, configure the alarm rules by clicking the "Add" button. In the pop-up box, set up the alarm rule parameters. The parameters include:
- Name: Alarm name
- Controller: The controller to which the alarm measuring point belongs
- Measuring point name: The name of the measuring point that triggered the alarm
- Alarm level: From low to high support "Remind", "Warning", "Secondary", "Important", "Serious"
- Alert Condition:
- Judgment condition: Support "=", "! = ", ">", "≥", "<", "≤"
- Logical conditions:
- No logic condition: The alarm is judged only by a single judgment condition
- && : Judging an alarm by two judging conditions
- | | : To determine an alarm, use a logical OR relationship between two conditions. This means that the alarm is triggered if either of the two conditions is met.
- Alarm content: the alarm content
- Alarm label: The alarm label is used to classify the alarm and facilitate quick selection when the alarm is uploaded to the cloud
The following picture shows an alarm with alarm level of alert, which belongs to the default tag. This alarm is generated when the value of the measuring point is >30 and <50; When it is not in this range, no alarm will be generated or the alarm will be eliminated.
In the "Alarm Rules" page, "Import" and "Export" CSV files of alarm rules refer to the Alarm Rules CSV file parameter description
The "Add to Label" function can help us quickly switch multiple alarm items to the alarm label. The following picture is the batch addition of alarm items to the "group_test" alarm label.
2.3 History Alarms
The historical alarms page can help us view the history of all alarm items, including triggered and recovered alarms. This function can help us understand the reason and time when the gateway side triggers/recovers the alarm items.
In the current page, you will see information about all the historical alarms that have been triggered and recovered.
The current page displays parameters that include those configured on the "Alarm Rules" page, such as "Name," "Controller," "Alarm Level," and "Alarm Content." Other parameters in the table are as follows:
- "Status" : There are two states, which are "triggered" and "Restored". "Triggered" means that the current alarm item is triggering an alarm; "Restored" means that the current alarm item has returned to normal.
- "Value" : The value of the alarm item at the moment the current state has been triggered or has been restored.
- "Time" : The time when the alarm was triggered or restored.
- "Operation" : Click the "Details" button to see the detailed information when the current alarm item is triggered or restored, and the "Delete" button can delete the current alarm item in the history of alarms.
2.4 Alarm Label
The alarm label can help us manage the alarm items. When the alarm item triggers an alarm, the MQTT message needs to be reported. Directly selecting the alarm label can quickly include all the alarm items under the alarm label. And when we need to report MQTT messages with different topics, we can add an alarm label to group different alarm items, and then select the corresponding label in different MQTT topics.
Go to the alarm label page to view the content of the alarm label.
In the table on the current page, there will be an alarm label named "default" by default (Note: this label cannot be deleted, and the rest of the added alarm labels can be deleted).
After clicking the "Add" button, configure the name of the alarm label in the pop-up box. (Note: This name is unique throughout the alarm label and cannot be repeated).
In the "Alarm Label" page, "Import" and "Export" Alarm rule CSV files, please refer to the Alarm label CSV file parameter introduction
Note: When deleting a label, the alarm items belonging to the current label in the "Alarm Rule" will be deleted together
3. Cloud
In industrial scenarios, the collected data needs to be reported to the cloud platform to help enterprises achieve centralized management, intelligent analysis and remote management of data. In DSA, we can enable and configure corresponding cloud services in the cloud service interface to help customers quickly connect to use mainstream cloud services.
3.1 MQTT Cloud Services
In the current page, you can view the connection status and configuration information of the current MQTT cloud service, and you can edit, import, export and other operations on the MQTT cloud service. Click the "Add" button to add a new MQTT cloud platform. For example, when we need to report data to multiple cloud platforms at the same time, we can add a new MQTT platform to connect to the cloud platform to report data. (Note: the name of the MQTT platform cannot be repeated, and the name of the default MQTT cloud platform is "Default"). As shown in the figure, add an MQTT platform with the name "test" :
The interface after adding is as shown in the figure:
After checking Enable cloud services, MQTT cloud services can be selected in the "Cloud Types" of the configuration interface. "Cloud Types" : The currently supported cloud platforms are "MQTT", "MQTT SparkPlugB", "iSCADA Cloud", "White Eagle Energy Manager", "Alibaba Cloud", "AWS IoT", "Azure IoT".
- "Clear Offline Cache" : This function can clear MQTT messages that failed to be published after the MQTT Cloud service went offline. For example, when we debug the MQTT function and the offline data generated do not want to be reported to the cloud platform, we can use this function to clear the offline data (Note: only messages with Qos greater than or equal to 1 are cached).
- "Import" : Select the configuration file of the MQTT cloud service to import the MQTT configuration in the file and the script in the message management. This function can quickly configure and enable the cloud service. For example, when configuring the same cloud service on different gateways, the configuration file exported after configuring one gateway can be directly imported into other gateways for use.
- "Export" : Click to export the configuration of the cloud and the script in the message management to a "cloud.json" file.
In the "cloud measuring point Settings" interface, you can shield the measuring point (after shielding, the measuring point will not be reported), modify the name of the cloud measuring point and other operations.
- "Cloud Measuring Point Name" : The name of the measuring point reported to the cloud platform is reported with the name in the current configuration item
- "Mute" : After muted, the measuring point will no longer be reported to the cloud platform
- "Import" and "Export" can respectively import the configuration information of the upper cloud measuring point Settings to the current gateway, or export the upper cloud measuring point information of the current gateway (note: the CSV file in the upper cloud measuring point Settings only saves the change of the name of the upper cloud measuring point or the muted measuring point). For the specific introduction of CSV file parameters, please refer to the Description of CSV fileparameters for Settings of Upper cloud measuring points
- "Message Management" : Here you can add publish script and subscribe script. Only when the script is added, can the message be published to the cloud platform and subscribe to the message of the cloud platform (Note: after enabling the MQTT SparkPlugB cloud service, the message is added by default and cannot be added but can only be modified)
4. Protocol
In industrial settings, data often exhibits diversity and complexity, and different application scenarios may require different communication protocols to meet their specific needs. DSA's protocol conversion functionality enables data to be uploaded in various application scenarios through different protocols. For example, using the Modbus TCP Slave protocol, data collected by controllers can be forwarded to SCADA servers.
The status page allows you to view the connection and running status of the current protocol (Note: not all protocols have status pages, such as BACnet Server protocol)
The configuration page can configure and view the connection parameters and add the mapping table function for the current protocol. For example, in the Modbus TCP Slave configuration interface, you can configure the Modbus TCP Slave port number, the maximum number of connections and other parameters. In the mapping table, you can perform add/edit, import/export and other operations.
For the specific mapping table CSV file, please refer to the Mapping table CSV file parameter introduction
For specific protocol configuration, please refer to the Appendix: Protocol conversion
5. Parameter Settings
In the parameter setting screen, you can configure the general Settings of the gateway. Such as setting gateway serial port parameters, storage configuration and custom parameters.
5.1Serial port Settings
In the serial port Settings page, you can configure the parameters of the serial port, such as the configuration of the serial port baud rate, data bits, etc.
The parameters of serial port Settings are shown in the figure:
The parameters are explained as follows (same for RS232 and RS485) :
- Baud Rate: support 300, 1200, 2400, 4800, 9600, 19200, 39400, 57600, 115200, 230400. The default is 9600
- Data Bits: 8 and 7 are supported. The default is 8
- Parity: supports no check, odd check and even check. The default is no parity
- Stop bit: 1 and 2 are supported. The default is 1
Click the "Submit" button to save your configuration after you've modified it.
5.2 Storage Configuration
In the storage configuration interface, you can configure the log storage of the gateway, the MQTT offline data storage and the communication packet storage of the controller.
The parameters of storage configuration are shown in the figure:
The parameters are explained as follows:
- Log level: The log level of the log output, the log below this level will not be displayed in the log. The log level from lowest to highest supports DEBUG,INFO,WARNING,ERROR. The default is INFO
- Historical alarm max: The maximum number of historical alarms in an alarm. Default 2000
- Offline Data storage Method: Support USB,SD card, gateway storage. The default is gateway storage
- Offline Data Max: The maximum number of offline data storage. Default 10000
- Offline Data Upload Period: The frequency of offline data reporting after offline data and other MQTT connections. Default 200ms
- Offline data retransmission policy: Support "retransmit all the time" and "retransmit a specified number of times and then discard". The default is "always retransmit". "Always retransmit" : The offline data will be retransmitted until the response from the server is received. "Retransmit the specified number of times and then discard" : After the specified number of retransmissions, if the response from the server is not received, the offline data will be discarded and the next one will be sent.
- After selecting "retransmit and discard after a specified number of times", two options will appear:
- Maximum Retransmission: The maximum number of times you can republish after a failure to publish. The default is 3 repostings
- Retransmission timeout: The amount of time to wait when Posting a message if no acknowledgement or reply is received, the default is 1000ms
- Communication Message Storage Method: Support USB,SD card, gateway storage. The default is gateway storage
- Max Stored Communication Messages:2000 by default
After modifying the configuration, click the "Submit" button to save the configuration. If you do not want to save the current changes, click the "Reset" button to restore the last saved configuration
5.3 Custom Parameter
Custom parameters are to define some global parameters, which can be used in cloud service configuration, fast function scripts. Set a global parameter to use, you can modify it more conveniently and quickly. For example, when a parameter needs to be used in multiple custom fast functions, if a custom parameter is used, then when the parameter value is changed, only the parameter value of the custom parameter interface is changed.
5.3.1Configure custom parameters
The parameters for custom parameters look like this:
By default, there are two parameters (note: these two parameters cannot be deleted or modified) :
- SN: The SN code of the device
- MAC: The MAC address of the device
If you want to add custom parameters, click the "Add" button, fill in the "Parameters" and "Parameters value" in the pop-up window, and click the "Confirm" button to add the modified value.
The "Import" and "Export" buttons can import the custom parameter configuration file to the current gateway and export the custom parameter of the current gateway into a configuration file respectively. For the specific CSV file, please refer to: Custom parameters CSV file parameter introduction
5.3.2Use custom parameters
You can add your own common parameters in custom parameters to be used as wildcards in cloud services and custom fast functions. The method is ${parameter name}, as shown in the following figure:
Custom parameters can also be used in scripts to get all custom parameters via the get_global_parameter() function.
An example script is as follows: (This script can output all the custom parameters in a log)
from common.Logger import logger
from quickfaas.global_dict import get_global_parameter
def main():logger.debug('get global dict: %s' % get_global_parameter())
In the custom fast function, add the script as shown:
The output will be:
6. Custom QuickFunctions
In the custom quickfunctions screen, you can add Python scripts to implement private logic (new scripts are enabled in a threaded manner). Custom fast function scripts support three trigger modes: periodic trigger; Local Subscription Message Trigger; QuickFunction start trigger.
The custom quick function interface button is introduced as shown below:
6.1 Periodic Trigger
A period-triggered quickfunction will trigger the script to run after the period ends
Below is a custom quickfunction that adds a 10-second cycle trigger, using the default script. This script will log "Timer start" and "Timer end" every 10 seconds.
The instructions for each parameter are as follows:
- Name: Any non-repeating name
- Mode: Select periodic trigger
- Periodic: The period that triggers this quickfunction. Units can be chosen: hours, minutes, seconds, the default is seconds.
- Entry Function: Stay the same as the entry function name in the script
- QuickFunction: Use Python code to customize the task logic of this periodic trigger script.
6.2Local Subscription Message Trigger
Local subscribe message trigger triggers the run script once when subscribed to the Topic that needs to be subscribed. The Topic on the gateway Event Bus can be looked from the Event BUS
Below is the local subscribe message fast function that adds a subscribe controller write value message. This script will be triggered when a value is written to the controller. With the default script, the write value message will be printed to the log
The parameters are described as follows:
- Name: Any non-repeating name
- Mode: Select local subscribe message to trigger
- Subscribe to Topic: Subscribe to the Topic of gateway internal messages
- Entry Function: Keep the same name as the entry function in the script
- Function code: Use Python code to customize the task logic of this periodic trigger script.
6.3QuickFunction start trigger
The QuickFunction start trigger, only when the fast function start is complete, triggers the run script once.
The diagram below shows how to add a quickfunction in the QuickFunction Start Trigger mode. Using the default script, "QuickFunction start" will be printed in the logs when the quickfunction is initiated.
The parameters are described as follows:
- Name: Any non-repeating name
- Mode: Select Quickfunction start trigger
- Entry Function: Keep the same name as the entry function in the script
- QuickFunction: Use Python code to customize the task logic of this periodic script.
Appendix: List of southbound drivers
AllenBrandly (Rockwell)
EtherNet/IP (CompactLogix)
EtherNet/IP is an industrial Ethernet protocol, which is used to realize communication and data exchange between devices in industrial control systems. It is based on the standard TCP/IP protocol stack, and added to it the application layer protocol used in the field of industrial automation, providing the support of real-time, reliability and security.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select EtherNet/IP (CompactLogix)
- IP Address: IP address
- Port: Port information
- Polling Interval: the time interval of data collection (seconds), for example, set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple polling Interval: Once enabled, you can configure an additional polling interval and select certain measuring points under the controller to use the polling interval. This function can be used to distinguish the measuring points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling interval (in seconds) that needs to be set after enabling multiple polling interval;
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connect Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- STRING: 8-bit string
- BCD16:16-bit BCD code
- Read Bit Data: When the data type is selected other than BIT,FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
- Example description of measuring point address:
A1: Consistent with the PLC address, pay attention to the data type should also be consistent;
Program:MainProgram.A1: If the variable is local, prefix it with the program name;
slot=2; A1: Addresses can also carry additional slot information;
i=A[0] : If A in PLC is based on A bool array of uint type, each bit in A can be accessed using this way;
B[0] : If B is an array, each element can be accessed using an index
EtherNet/IP (Micro)
EtherNet/IP (Micro) is a variant of the EtherNet/IP protocol designed for smaller devices and resource-constrained environments. Compared with the standard EtherNet/IP protocol, EtherNet/IP (Micro) uses a more simplified message format and lightweight communication mechanism in the communication process to reduce resource consumption and communication overhead.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select EtherNet/IP (MIcro)
- IP Address: IP address
- Port: Port information
- Polling Interval: the time interval of data collection (seconds), for example, set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling interval and select certain measuring points under the controller to use the polling interval. This function can be used to distinguish the measuring points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling interval (in seconds) that needs to be set after enabling multiple polling interval;
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connect Timeout: the timeout time for establishing the connection.
- Slot:PLC slot
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- BCD16:16-bit BCD code
- FLOAT: 32-bit floating point number
- STRING: 8-bit string
- BCD16:16-bit BCD code
- Read Bit Data: When the data type is selected other than BIT,FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
- Example description of measuring point address:
A1: Consistent with the PLC address, pay attention to the data type should also be consistent;
Program:MainProgram.A1: If the variable is local, prefix it with the program name;
slot=2; A1: Addresses can also carry additional slot information;
i=A[0] : If A in PLC is based on A bool array of uint type, each bit in A can be accessed using this way;
B[0] : If B is an array, each element can be accessed using an index
EtherNet/IP (MicroLogix)
EtherNet/IP (MicroLogix) refers to the use of EtherNet/IP protocol for communication in the MicroLogix controller family
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select EtherNet/IP (MIcroLogix)
- IP Address: IP address
- Port: Port information
- Polling Interval: the time interval of data collection (seconds), for example, set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple polling Interval: Once enabled, you can configure an additional polling interval and select certain measuring points under the controller to use the polling interval. This function can be used to distinguish the measuring points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling interval (in seconds) that needs to be set after enabling multiple polling interval;
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connect Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- STRING: 8-bit string
- Read Bit Data: When the data type is selected other than BIT,FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
- Example description of measuring point address:
A9:0: ASCII
B2:0: Bit
N2:0:Integer
L17:0:Long Integer
ST2:0:String
F8:5:Floating
S:1/15:Status
C2:0:Counter
T2:0:Timer
I:0/15:Input
O:0/15:Output
EtherNet/IP (Unconnected)
EtherNet/IP (Unconnected) refers to a method of communication used in the EtherNet/IP protocol. Unconnected means that there is no need to establish a persistent connection when communicating, and each communication is independent and immediate. This method is similar to the connectionless communication method in the UDP protocol, which is more lightweight and flexible, and is suitable for some scenarios with less stringent real-time requirements.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select EtherNet/IP (Unconnected)
- IP Address: IP address
- Port : Port information
- Polling Interval: the time interval of data collection (seconds), for example, set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling interval and select certain measuring points under the controller to use the polling interval. This function can be used to distinguish the measuring points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling interval (in seconds) that needs to be set after enabling multiple polling interval;
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connect Timeout: the timeout time for establishing the connection.
- Slot:PLC slot
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Symbol: the address of the measuring point
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- STRING: 8-bit string
- Read Bit Data: When the data type is selected other than BIT,FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
- Example description of measuring point address:
A1: Consistent with the PLC address, pay attention to the data type should also be consistent;
Program:MainProgram.A1: If the variable is local, prefix it with the program name;
slot=2; A1: Addresses can also carry additional slot information;
i=A[0] : If A in PLC is based on A bool array of uint type, each bit in A can be accessed using this way;
B[0] : If B is an array, each element can be accessed using an index
*SLC Net
SLC Net stands for "Symbian Limited Compatibility Network" and it is the network communication protocol for Symbian OS. Symbian OS is a kind of operating system that has been widely used in smart phones and mobile devices. It provides a wealth of functions and application support.
Adding controllers
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select *SLC Net
- IP Address: IP address
- Port: Port information
- Polling Interval: the time interval of data collection (seconds), for example, set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling interval and select certain measuring points under the controller to use the polling interval. This function can be used to distinguish the measuring points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling interval (in seconds) that needs to be set after enabling multiple polling interval;
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connect Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- STRING: 8-bit string
- BCD16:16-bit BCD code
- Read Bit Data: When the data type is selected other than BIT,FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
- Example description of measuring point address:
A9:0: ASCII variable
B2:0: Bit variable
N2:0: Integer variables
F8:5: Floating point
S:1/15: Status variable
ST2:0: String
C2:0: Counter
I:0/15: Input
O:0/15: Output
R9:0: Control
T2:0: Timer
L9:0: Long Integer
DLT meter
DLT645-1997
DLT645-1997 is a version of the Chinese national standard GB/T 645-1997 "Multi-function Meter Communication Protocol". This standard specifies the communication protocol and data format between the multi-function meter and the external equipment, which is used for data exchange and communication between the meter and the monitoring system.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select DLT645-1997
- Slave: Table Number
- Endpoint: Support RS485 and RS232
- Polling Interval: the time interval of data collection (seconds), for example, set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling interval and select certain measuring points under the controller to use the polling interval. This function can be used to distinguish the measuring points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling interval (in seconds) that needs to be set after enabling multiple polling interval;
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Communication time setting:
- Communication Interval Time: The interval time between message exchanges, i.e., after receiving a response from the device, it will wait for a communication interval before sending the next request message.
- Communication Message Settings:
- Store of Communication Message: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: The address of the measuring point, the address format supports 0000 or 00-00.
- Data type: Measuring point data type, including:
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: A 64-bit floating point number
- STRING: 8-bit string
- Read Bit Data: When the data type is selected other than FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
LT645-2007
DLT645-2007 is a version of the Chinese national standard GB/T 645-2007 "Multi-function Meter Communication Protocol". This standard is an important version of the DLT645 series of standards, which is used to specify the communication protocol and data format between the multifunctional electric energy meter and the external equipment.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select DLT645-2007
- Slave: Table Number
- Endpoint: Support RS485 and RS232
- Polling Interval: the time interval of data collection (seconds), for example, set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple polling Interval: Once enabled, you can configure an additional polling interval and select certain measuring points under the controller to use the polling interval. This function can be used to distinguish the measuring points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling interval (in seconds) that needs to be set after enabling multiple polling interval;
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Communication time setting:
- Communication Interval Time: The interval time between message exchanges, i.e., after receiving a response from the device, it will wait for a communication interval before sending the next request message.
- Initialization on Open: Whether to perform the operation of activation command when opening the serial port. After opening, add FE FE FE FE to the packet frame header.
- Communication Message Settings:
- Store Communication Message: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: The address of the measuring point, the address format supports 0000 or 00-00.
- Data type: Measuring point data type, including:
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: A 64-bit floating point number
- STRING: 8-bit string
- Read Bit Data: When the data type is selected other than FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
LT645-2007 over TCP
DLT645-2007 over TCP refers to the DLT645-2007 communication protocol applied to TCP/IP network communication mode. DLT645-2007 is a version of the multi-function meter communication protocol, and TCP is a common transmission control protocol used to achieve reliable data transmission in the network. The communication mode of DLT645-2007 over TCP can make full use of the reliability and stability of TCP protocol to ensure the safe transmission and reliable reception of data. This method is suitable for remote monitoring and management of electric energy data scenarios, such as power system monitoring, energy management systems, etc.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select DLT645-2007 over TCP
- Station No: Table number
- IP Address: The IP address of the meter
- Port: The port information of the meter
- Polling Interval: It is the time interval of collecting data (seconds), for example, it is set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling cycle (in seconds) that needs to be set after enabling multiple polling cycles;
- Description: You can add comment information to this controller
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connect Timeout: the timeout time for establishing the connection.
- Initialize activation: Whether to activate the command when opening the serial port. After opening, add FE FE FE FE to the packet frame header.
- Communication Timing Settings:
- Communication Interval: The interval time between message exchanges, i.e., after receiving a response from the device, it will wait for a communication interval before sending the next request message.
- Communication Message Settings:
- Storage of communication messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: Address of measuring point, address format only supports 00-00 format (" - "must be added).
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned integer
- SINT: 8-bit signed integer
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- BCD16:16-bit BCD code
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: A 64-bit floating point number
- STRING: 8-bit string
- Read Bit Data: When the data type is selected other than FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
*DLT698
DLT698 is an implementation of Chinese national standard GB/T 26880-2011 "Power information acquisition system communication protocol", it is based on the IEC 62056 series standard (DLT645) power information acquisition system communication protocol. DLT698 is mainly used for data acquisition, transmission and management in electric power information acquisition system. It is a general communication protocol in electric power industry.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select *DLT698
- Station No: Support RS485 and RS232
- Polling Interval: the time interval of data collection (seconds), for example, set to 10S, then all the measuring points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling interval and select certain measuring points under the controller to use the polling interval. This function can be used to distinguish the measuring points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: It is an additional polling interval (in seconds) that needs to be set after enabling multiple polling interval;
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Communication Timing Settings:
- Communication Interval Time: The interval time between message exchanges, i.e., after receiving a response from the device, it will wait for a communication interval before sending the next request message.
- Communication Message Settings:
- Store Communication Message: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameters" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: Address of measuring point, address format only supports 00-00 format (" - "must be added).
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned integer
- SINT: 8-bit signed integer
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- BCD16:16-bit BCD code
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: A 64-bit floating point number
- STRING: 8-bit string
- Read Bit Data: When the data type is selected other than FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
IEC 60870
IEC 101
IEC 101 is a standard protocol developed by the International Electrotechnical Commission (IEC) for telecommunication. It is a communication protocol for monitoring and control of power systems, which is mainly used for applications such as remote monitoring, control, data acquisition and protection in power systems.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: IEC 101 is selected
- Communication Mode: support “Balanced Transmission” and “Unbalanced Transmission”, “Unbalanced Transmission” only supports one side of the communication at the same time to send data, belongs to half duplex, suitable for RS485 scenario, “Balanced Transmission” can support both sides of the communication to send data at the same time, belongs to full duplex, suitable for RS232 scenario
- Link Address Size: support 1 and 2. The number of bits or bytes used to represent the address of a device in the link layer
- Link Address: A unique identifier used in the link layer to identify a communicating device
- ASDU Size: The byte length of the application service data unit, which is the length of the CA public address, the ASDU field is used to distinguish different sub-stations on this link. If more than one substation needs to be collected, more than one controller needs to be configured. 1 and 2 are supported, the default is 2, in bytes
- ASDU Address: Application service data unit public address, also known as CA public address. An address or identifier used in a protocol to identify and distinguish between different ASdus
- IOA Size: information object address byte length, the length of IOA determines the number and range of monitoring points, the default is 2, unit byte
- COT Size: transmission cause byte length, determines the number of transmission causes that can be represented, the default is 2, unit byte
- Originator Address: Used to identify the address of the device or system that sends the data packet, identifying the source of the data packet
- Endpoint: support RS485 and RS232
- General Interrogation Interval: the time interval during which the system regularly sends the total call command
- Counter Interrogation Interval: The time interval at which the control system regularly sends the power total call command
- Description: Note information can be added to this controller
Advanced Settings:
- Timeout: The timeout time of the device response after the reading request is initiated to the device when the measuring point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Link confirmation timeout: the maximum time for the initiator to wait for a response from the receiver when a packet is interacting
- Clock Sysc: When enabled, a clock synchronization command is periodically sent to the slave device to inform the device of the current system time or calibration value
- Clock Sync Interval: The frequency at which clock synchronization commands are sent
- Operate Mode: supports "Direct Operate" and "Select then Operate ". The "Direct Operate" command is sent directly by the master station to the remote device, and the device performs the corresponding operation immediately after receiving the command, without waiting for additional confirmation or response. In the " Select then Operate" mode, the master station first sends a selection command to the remote device, which indicates that the device is ready to perform a specific action, but does not execute it immediately for the time being. Upon receiving the selection command, the device will place the action in the pending state and send an acknowledgement response to the master indicating that the selection command has been accepted. The master then sends another action command that instructs the device to perform a specific action. After receiving the operation command, the device performs the corresponding operation and sends an acknowledgement response to the master station, indicating that the operation has been performed.
- Communication message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the " Realtime Communication Message " page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Register Type: Select the Type Identification (TI) of IEC101 from the dropdown menu.
- IOA Size: Identifies the address of the information object, an integer from 1 to 16777215
- Data type: Depending on the address type, the data types supported in the data type are also different. After you select an address type, select the actual supported data type from the drop-down list.
- Read Bit Data: When the data type is selected other than FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions: Depending on the address type, the supported read and write permissions are different. After you select an address type, select the actual supported read and write permissions from the drop-down list.
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
IEC 104
IEC 104 is an international standard protocol for remote communication in power systems. It was developed by the International Electrotechnical Commission (IEC) and is a communication protocol for monitoring, controlling, and protecting power systems. The IEC 104 protocol is built on top of the TCP/IP network protocol and usually uses TCP or UDP as the transport layer protocol to achieve reliable transmission of data in the network. It adopts a distributed and object-oriented communication model, and supports client-server and multicast communication modes.
IEC 104 protocol is mainly used for communication between remote terminal unit (RTU), remote control device, remote communication device and other equipment. It provides an efficient and reliable data transmission mechanism, which supports a variety of data types and function codes, such as telemetry data collection, remote communication information transmission, remote operation execution, etc.
Adding a controller
- Name: The name
of the controller, which is unique in the controller list for the entire
gateway
- Protocol: Select
IEC 104
- IP Address: Master
IP address
- ASDU address: The
byte length of the application service data unit, that is, the length of the CA
public address, the ASDU field is used to distinguish between different
sub-stations on this link. If multiple substations need to be collected,
multiple controllers need to be configured
- Port: Master
port information
- COT Size:
Transfer cause byte length, determines the number of transfer causes that can
be represented, the default is 2
- General
Interrogation Interval: The time interval during which the system sends the
total call command on a regular basis
- Counter
Interrogation Interval: The time interval at which the control system regularly
sends the power total call command
Advanced
Settings:
- K Value: The
maximum number of I format (information) APDU (k) that has not been confirmed.
Range 1-32, default 12.
- W value:
Receiver acknowledges after receiving w I format (information) APdus, range
1-32, default 8.
- T0 Timeout (S) :
T0 timeout is the timeout that the master waits for a response from the slave
after sending the start frame. If no response frame is received from the slave
within the T0 timeout period, the master will consider the communication failed
and act accordingly. Range 1-3000, default is 30 in seconds.
- T1 Timeout (S) :
t1 stipulates that after the sender sends an I format packet or U format
(control) packet, it must be accepted by the receiver within the time of t1,
otherwise the sender considers that the TCP connection has a problem and should
re-establish the connection. Range 1-3000, default is 15 in seconds.
- T2 Timeout (S) :
t2 stipulates that after receiving an I format packet, if the receiver does not
receive a new I format packet after t2 time, it must send an S format
(monitoring) frame to the sender to acknowledge the received I format packet.
Range 1-3000, default is 10, in seconds. Note: T2 < T1
- T3 Timeout (S) :
t3 stipulates that the dispatcher or the sub-station RTU will retrigger the
timer t3 every time it receives an I frame, S frame or U frame. If no packet is
received within t3, it will send a test link frame to the other side. Range
1-3000, default is 20, the unit is seconds. Note: T3 > T1
- Clock Sys: When
enabled, a clock synchronization command will be sent to the slave device
periodically to inform the device of the current system time or calibration
value
- Clock Sync
Interval: The frequency at which clock synchronization commands are sent
- Operate Mode:
Support "direct operation" and "select operation". The
"Direct operation" command is sent directly by the master station to
the remote device, and the device performs the corresponding operation
immediately after receiving the command, without waiting for additional
confirmation or response. In the "Operation after Selection" mode,
the master station first sends a selection command to the remote device, which
indicates that the device is ready to perform a specific action, but does not
execute it immediately for the time being. Upon receiving the selection
command, the device will place the action in the pending state and send an
acknowledgement response to the master indicating that the selection command
has been accepted. The master then sends another action command that instructs
the device to perform a specific action. After receiving the operation command,
the device performs the corresponding operation and sends an acknowledgement
response to the master station, indicating that the operation has been
performed.
- Communication Message
Settings:
- Store Communication
Messages: The controller with this function enabled will store communication
messages. The storage path and number can be set in the "Default
Parameter" of the "Parameter Settings" page. If you need to
download the stored communication message, you can enter the "Realtime
Communication Message" page of the specified controller in the "Measure
Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Register Type: Select the Type Identification (TI) of IEC104 from the dropdown menu.
- IOA Size: Identifies the address of the information object, an integer from 1 to 16777215
- Data type: Depending on the address type, the data types supported in the data type are also different. After you select an address type, select the actual supported data type from the drop-down list.
- Read Bit Data: When the data type is selected other than FLOAT,STRING, the value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT, the maximum is 6 digits
- Read and write permissions: Depending on the address type, the supported read and write permissions are different. After you select an address type, select the actual supported read and write permissions from the drop-down list.
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measuring point belongs, and the historical data will be stored according to the storage policy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measuring point is not BIT or STRING, and the bitwise value is not enabled, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
Modbus
Modbus ASCII
Modbus ASCII is a Modbus communication protocol based on ASCII character encoding for data exchange and device control in serial communication. It is a variant of the Modbus protocol and usually runs on serial communication media such as RS-232 or RS-485. The Modbus ASCII protocol is commonly used in industrial control systems for data exchange between devices and control operations. It supports a variety of function codes, including read/write registers, read/write coils, etc., which can be used to realize the monitoring and control of remote devices. The Modbus ASCII protocol is simple and easy to use, and is suitable for smaller scale systems and devices
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select Modbus ASCII
- Slave: The unique identification of the slave device
- Endpoint: Support RS485 and RS232, default use RS485
- Polling Interval: It is the time interval of data collection (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Byte order:
- 16 Bit Int: Both AB and BA are supported, and AB endianness is used by default
- 32 Bit Int: Supports ABCD, CDAB, DCBA, BADC, defaults to ABCD byte order
- 32 Bit Float: ABCD, CDAB, DCBA, BADC are supported, and ABCD byte order is used by default
- 64 Bit Int: supports ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG, defaults to ABCDEFGH
- 64 Bit Float: ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG are supported
Byte order, ABCDEFGH is used by default
- Enable Package Reporting: Measurement points under controllers with this feature enabled can be configured for individual polling cycles (in milliseconds). Measurement points that have " Enable Package Reporting " enabled collect data according to the set polling cycle and frequency, and publish the aggregated data to the local MQTT topic "ds2/eventbus/south/upload/msec/data/{controllerName}". A quick function with the mode "Local Subscription Message Trigger" can be added on the "Custom Quick Functions" page to subscribe to this topic, where the grouped data can be processed within the quick function.
- Packet Data Polling Interval: The polling period for group packet data.
- Millisecond Data uploading: How many times the group packet data is polled, it is reported uniformly.
- Continuous Collection: Whether to carry out batch acquisition of the measurement points under the controller. For example, in the modbus protocol, after starting batch acquisition, all the measurement points with continuous addresses will be read in one read request, which can effectively improve the collection efficiency.
- Continuous Collection Address: After enabling continuous collection, the maximum number of measurement points allowed to be collected at one time should be configured.
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Communication time setting:
- Communication Interval Time: the interval time of packet interaction, that is, after receiving the response of the device, it will wait for a communication interval before sending the next request packet.
- Write function code settings:
- Coil Outputs Write Function Code: Supports 15 (to write multiple coil registers at once) and 05 (to write a single coil register at a time), 15 is used by default
- Holding Register Write Function Code: Supports 16 (write multiple hold registers at a time) and 06 (write a single hold register at a time), uses 16 by default
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point. Support 0X (coil register), 1X (discrete register), 3X (input register), 4X (hold register)
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- BCD16:16-bit BCD code
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- BCD32:32-bit BCD code
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
Modbus RTU
Modbus RTU (Remote Terminal Unit) is a commonly used serial communication protocol, which is used for data exchange and control operations between devices in industrial control systems. It is a variant of the Modbus protocol and usually runs on serial communication media (such as RS-232, RS-485). The Modbus RTU protocol supports a variety of function codes, including read/write hold registers, read/write coils, etc., which can be used to monitor and control remote devices. It has been widely used in the field of industrial control, because of its simple to use, low cost, reliable and stable characteristics, suitable for all sizes and types of industrial control systems.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select Modbus RTU
- Slave: The unique identification of the slave device
- Endpoint: Support RS485 and RS232, default use RS485
- Polling Interval: It is the time interval of data collection (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Byte order:
- 16 Bit Int: Both AB and BA are supported, and AB endianness is used by default
- 32 Bit Int: Supports ABCD, CDAB, DCBA, BADC, defaults to ABCD byte order
- 32 Bit Float: ABCD, CDAB, DCBA, BADC are supported, and ABCD byte order is used by default
- 64 Bit Int: supports ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG, defaults to ABCDEFGH
- 64 Bit Float: ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG are supported
- Byte order, ABCDEFGH is used by default
- Enable Package Reporting: Measurement points under controllers with this feature enabled can be configured for individual polling cycles (in milliseconds). Measurement points that have " Enable Package Reporting " enabled collect data according to the set polling cycle and frequency, and publish the aggregated data to the local MQTT topic "ds2/eventbus/south/upload/msec/data/{controllerName}". A quick function with the mode "Local Subscription Message Trigger" can be added on the "Custom Quick Functions" page to subscribe to this topic, where the grouped data can be processed within the quick function.Packet Data Polling Interval: The polling period for group packet data.
- Packet Data Polling Interval: The polling period for group packet data.
- Millisecond Data uploading: How many times the group packet data is polled, it is reported uniformly.
- Continuous Collection: Whether to carry out batch acquisition of the measurement points under the controller. For example, in the modbus protocol, after starting batch acquisition, all the measurement points with continuous addresses will be read in one read request, which can effectively improve the collection efficiency.
- Continuous Collection Address: After enabling continuous collection, the maximum number of measurement points allowed to be collected at one time should be configured.
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Communication time setting:
- Communication Interval Time: the interval time of packet interaction, that is, after receiving the response of the device, it will wait for a communication interval before sending the next request packet.
- Write function code settings:
- Coil Outputs Write Function Code: Supports 15 (to write multiple coil registers at once) and 05 (to write a single coil register at a time), 15 is used by default
- Holding Register Write Function Code: Supports 16 (write multiple hold registers at a time) and 06 (write a single hold register at a time), uses 16 by default
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point. Support 0X (coil register), 1X (discrete register), 3X (input register), 4X (hold register)
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- BCD16:16-bit BCD code
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- BCD32:32-bit BCD code
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
Modbus RTU over TCP
Modbus RTU over TCP refers to a way to wrap the Modbus RTU protocol in the TCP/IP network protocol for transmission. In this mode, Modbus RTU data frames are encapsulated in TCP packets and transmitted over the TCP/IP network. In Modbus RTU over TCP, Modbus RTU data frames are encapsulated in the data part of the TCP packet and transmitted over a TCP connection. After receiving the TCP packet, the receiver parses it out of the Modbus RTU data frame before processing and responding. This method retains the original characteristics of Modbus RTU protocol, while taking advantage of the reliability and flexibility provided by TCP/IP network, and is suitable for industrial control systems of all sizes and complexities.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select Modbus RTU over TCP
- IP Address: The IP address of the slave
- Port :The port information of the slave
- Slave: The unique identification of the slave device
- Endpoint: Support RS485 and RS232, default use RS485
- Polling Interval: It is the time interval of data collection (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Byte order:
- 16 Bit Int: Both AB and BA are supported, and AB endianness is used by default
- 32 Bit Int: Supports ABCD, CDAB, DCBA, BADC, defaults to ABCD byte order
- 32 Bit Float: ABCD, CDAB, DCBA, BADC are supported, and ABCD byte order is used by default
- 64 Bit Int: supports ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG, defaults to ABCDEFGH
- 64 Bit Float: ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG are supported
Byte order, ABCDEFGH is used by default
- Enable Package Reporting: Measurement points under controllers with this feature enabled can be configured for individual polling cycles (in milliseconds). Measurement points that have " Enable Package Reporting " enabled collect data according to the set polling cycle and frequency, and publish the aggregated data to the local MQTT topic "ds2/eventbus/south/upload/msec/data/{controllerName}". A quick function with the mode "Local Subscription Message Trigger" can be added on the "Custom Quick Functions" page to subscribe to this topic, where the grouped data can be processed within the quick function.Packet Data Polling Interval: The polling period for group packet data.
- Packet Data Polling Interval: The polling period for group packet data.
- Millisecond Data uploading: How many times the group packet data is polled, it is reported uniformly.
- Continuous Collection: Whether to carry out batch acquisition of the measurement points under the controller. For example, in the modbus protocol, after starting batch acquisition, all the measurement points with continuous addresses will be read in one read request, which can effectively improve the collection efficiency.
- Continuous Collection Address: After enabling continuous collection, the maximum number of measurement points allowed to be collected at one time should be configured.
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Communication time setting:
- Communication Interval Time: the interval time of packet interaction, that is, after receiving the response of the device, it will wait for a communication interval before sending the next request packet.
- Write function code settings:
- Coil Outputs Write Function Code: Supports 15 (to write multiple coil registers at once) and 05 (to write a single coil register at a time), 15 is used by default
- Holding Register Write Function Code: Supports 16 (write multiple hold registers at a time) and 06 (write a single hold register at a time), uses 16 by default
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point. Support 0X (coil register), 1X (discrete register), 3X (input register), 4X (hold register)
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- BCD16:16-bit BCD code
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- BCD32:32-bit BCD code
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
Modbus TCP
Modbus TCP is an Ethernet-based version of the Modbus protocol that uses the TCP/IP protocol for communication. Unlike the traditional Modbus RTU protocol, Modbus TCP allows devices to communicate directly over Ethernet without any dedicated hardware or communication interfaces. Therefore, Modbus TCP has a higher communication rate and a wider range of applications.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select Modbus TCP
- IP Address: The IP address of the slave
- Port :The port information of the slave
- Slave: The unique identification of the slave device
- Endpoint: Support RS485 and RS232, default use RS485
- Polling Interval: It is the time interval of data collection (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Byte order:
- 16 Bit Int: Both AB and BA are supported, and AB endianness is used by default
- 32 Bit Int: Supports ABCD, CDAB, DCBA, BADC, defaults to ABCD byte order
- 32 Bit Float: ABCD, CDAB, DCBA, BADC are supported, and ABCD byte order is used by default
- 64 Bit Int: supports ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG, defaults to ABCDEFGH
- 64 Bit Float: ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG are supported
Byte order, ABCDEFGH is used by default
- Enable Package Reporting: Measurement points under controllers with this feature enabled can be configured for individual polling cycles (in milliseconds). Measurement points that have " Enable Package Reporting " enabled collect data according to the set polling cycle and frequency, and publish the aggregated data to the local MQTT topic "ds2/eventbus/south/upload/msec/data/{controllerName}". A quick function with the mode "Local Subscription Message Trigger" can be added on the "Custom Quick Functions" page to subscribe to this topic, where the grouped data can be processed within the quick function.Packet Data Polling Interval: The polling period for group packet data.
- Packet Data Polling Interval: The polling period for group packet data.
- Millisecond Data uploading: How many times the group packet data is polled, it is reported uniformly.
- Continuous Collection: Whether to carry out batch acquisition of the measurement points under the controller. For example, in the modbus protocol, after starting batch acquisition, all the measurement points with continuous addresses will be read in one read request, which can effectively improve the collection efficiency.
- Continuous Collection Address: After enabling continuous collection, the maximum number of measurement points allowed to be collected at one time should be configured.
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Communication time setting:
- Communication Interval Time: the interval time of packet interaction, that is, after receiving the response of the device, it will wait for a communication interval before sending the next request packet.
- Write function code settings:
- Coil Outputs Write Function Code: Supports 15 (to write multiple coil registers at once) and 05 (to write a single coil register at a time), 15 is used by default
- Holding Register Write Function Code: Supports 16 (write multiple hold registers at a time) and 06 (write a single hold register at a time), uses 16 by default
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point. Support 0X (coil register), 1X (discrete register), 3X (input register), 4X (hold register)
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- BCD16:16-bit BCD code
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- BCD32:32-bit BCD code
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
Modbus RTU Slave
A Modbus RTU Slave is a party that exists as a passive device in the Modbus RTU communication protocol, which receives and responds to commands from the Master and provides data to the master.
In the controller of the gateway, the Modbus RTU Slave is used as a read-only collector, and the registers in the Slave are configured to passively wait for the data packets sent by the master.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Modbus RTU Slave is selected
- Slave: The unique identification of the slave device
- Endpoint: Support RS485 and RS232, default use RS485
- Status expiration time: When the controller or the measurement point does not receive a new message within the specified time, the state will be automatically updated to offline
- Advanced Settings:
- Byte order:
- 16 Bit Int: Both AB and BA are supported, and AB endianness is used by default
- 32 Bit Int: Supports ABCD, CDAB, DCBA, BADC, defaults to ABCD byte order
- 32 Bit Float: ABCD, CDAB, DCBA, BADC are supported, and ABCD byte order is used by default
- 64 Bit Int: supports ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG, defaults to ABCDEFGH
- 64 Bit Float: ABCDEFGH, GHEFCDAB, HGEFDCBA, BADCFEHG are supported
Byte order, ABCDEFGH is used by default
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point. Support 0X (coil register), 4X (hold register)
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- BCD16:16-bit BCD code
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- BCD32:32-bit BCD code
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
OPC
OPC DA
OPC DA stands for "OPC Data Access" and is a communication specification for enabling real-time data communication and exchange. It is based on Microsoft's COM/DCOM (Component Object Model/Distributed Component Object Model) technology, which aims to provide a standardized method for the development of OPC DA. It enables industrial automation equipment from different manufacturers to exchange data with OPC DA compatible software.
Adding controllers
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select OPC DA
- IP Address: The IP address of the device
- Host Name: The server name defined when installing and configuring that server
- Polling Interval: is the time interval of data collection (seconds), for example, set to 10S, then all measurement points under the controller will be polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Enable package Reporting: Measurement points under controllers with this feature enabled can be configured for individual polling cycles (in milliseconds). Measurement points that have " Enable Package Reporting " enabled collect data according to the set polling cycle and frequency, and publish the aggregated data to the local MQTT topic "ds2/eventbus/south/upload/msec/data/{controllerName}". A quick function with the mode "Local Subscription Message Trigger" can be added on the "Custom Quick Functions" page to subscribe to this topic, where the grouped data can be processed within the quick function.Packet Data Polling Interval: The polling period for group packet data.
- Packet Data Polling Interval: The polling period for group packet data.
- Millisecond Data uploading: How many times the group packet data is polled, it is reported uniformly.
- Continuous Collection: Whether to carry out batch acquisition of the measurement points under the controller. For example, in the modbus protocol, after starting batch acquisition, all the measurement points with continuous addresses will be read in one read request, which can effectively improve the collection efficiency.
- Continuous Collection Address: After enabling batch acquisition, the maximum number of measurement points allowed to be collected at one time should be configured.
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connection Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point.
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset And Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
OPC UA
OPC UA is a machine-to-machine communication protocol for industrial automation, developed and maintained by the OPC Foundation. OPC UA provides a standardized way to enable different devices and systems to communicate with each other.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select OPC UA
- Services URL: Fill in the server address plus port, for example: 192.168.2.1:4801
- Polling Interval: is the time interval of data collection (seconds), for example, set to 10S, then all measurement points under the controller will be polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Authentication: Support anonymous login, user name and password, authentication certificate three ways. The default is anonymous login.
- Security Policy:
- Message security mode (Note: when the security policy is None, message security mode can only be None; When the security policy is automatic detection, all three security modes can be selected; For other security policies, the message security mode can be selected among signature, signature and encryption.)
- Description: You can add comment information to this controller
Advanced Settings:
- Enable package Reporting: Measurement points under controllers with this feature enabled can be configured for individual polling cycles (in milliseconds). Measurement points that have " Enable Package Reporting " enabled collect data according to the set polling cycle and frequency, and publish the aggregated data to the local MQTT topic "ds2/eventbus/south/upload/msec/data/{controllerName}". A quick function with the mode "Local Subscription Message Trigger" can be added on the "Custom Quick Functions" page to subscribe to this topic, where the grouped data can be processed within the quick function.Packet Data Polling Interval: The polling period for group packet data.
- Packet Data Polling Interval: The polling period for group packet data.
- Millisecond Data uploading: How many times the group packet data is polled, it is reported uniformly.
- Continuous Collection: Whether to carry out batch acquisition of the measurement points under the controller. For example, in the modbus protocol, after starting batch acquisition, all the measurement points with continuous addresses will be read in one read request, which can effectively improve the collection efficiency.
- Continuous Collection Address: After enabling batch acquisition, the maximum number of measurement points allowed to be collected at one time should be configured.
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connection Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- NS(Namespace Index):An integer value used to identify and distinguish different namespaces, ranging from 0-65535
- Address Type:String and Number are supported
- Identifier:If the address type is String, you can fill in any string; If it is a Number, integer values are supported
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Is Array:Enable this feature if the measuring point is of array type.
- Array Index:Represents the position of the current point in the array, for example, the first element is indexed at 0, the second element is indexed at 1, and so on.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
*OPC UA PUBSUB
OPC UA PUBSUB is a communication mechanism in OPC UA (OPC Unified Architecture), which stands for "OPC UA Publisher/Subscriber". It is a communication method based on publish/subscribe model, which is used to publish and subscribe real-time data in industrial automation system.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select *OPC UA PUBSUB
- Middleware: Select the protocol used by OPCUA PUBSUB, which only supports UDP
- Publish Address: The destination address to send data to
- Subscribe address: The destination address from which data is received
- Publisher Id: A unique identifier that identifies the publisher, an unsigned 32-bit integer
- Subscribe Id: A unique identifier identifying the subscriber, unsigned 32-bit integer
- Status expiration time: When no new message is received by the controller or the measurement point within the specified time, the state will be automatically updated to offline
- Server Port: The port information of the server enabled by opcua pubsub. Note that the same port cannot be used with other services
- Description: You can add comment information to this controller
Adding measuring points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Sub Group Id: Keep the same as the Pub Group Id of the measurement point on the publishing side, ranging from 1-65535
- Sub Writer Id: Same as Pub Writer ld of this test point on publish side, range 1-65535
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Is Array:Enable this feature if the measuring point is of array type.
- Array Index:Represents the position of the current point in the array, for example, the first element is indexed at 0, the second element is indexed at 1, and so on.
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Pub Group Id: The publication group ID to which the measurement point belongs, range: 1-65535
- Pub Writer Id: Publication write ID to which the measurement point belongs, range: 1-65535
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
SIEMENS (Siemens)
*Fetch/Write
"Fetch/Write" refers to a data exchange operation commonly found in the field of industrial automation. It is commonly used to describe the process of fetching data (Fetch) from and writing data (Write) to a control device (e.g. PLC, sensor, etc.).
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select *Fetch/Write
- IP Address: The IP address of the device
- Port: The port information of the device
- Polling Interval: It is the time interval of collecting data (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connect Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: the address of the measuring point. Example: I1.6, Q1
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- BCD16:16-bit BCD code
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: A 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
ISO on TCP
"ISO on TCP" refers to communication over TCP/IP networks using a set of standards defined by ISO (International Organization for Standardization). ISO is an international standard-setting organization responsible for developing standards for a variety of industries, including information technology, communications, manufacturing, and more.
In the field of industrial automation, ISO provides many standards related to communication and data exchange, some of which can be applied to TCP/IP networks. These standards usually cover the data exchange protocol, communication interface, data format and other aspects of the specification, so that different equipment and systems can exchange data and communication.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select ISO on TCP
- IP Address: The IP address of the device
- Port: The port information of the device
- Mode: Two are supported, Rack/Slot and TSAP
- Rack number: The rack number of the PLC
- Slot number: The slot number information of the PLC
- Client TSAP: Usually includes Rack number, Slot number as well as specific TSAP address
- Server-side TSAP: Usually includes Rack number, Slot number, and specific TSAP address
- Polling Interval: It is the time interval of collecting data (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Enable Package Reporting: Measurement points under controllers with this feature enabled can be configured for individual polling cycles (in milliseconds). Measurement points that have " Enable Package Reporting " enabled collect data according to the set polling cycle and frequency, and publish the aggregated data to the local MQTT topic "ds2/eventbus/south/upload/msec/data/{controllerName}". A quick function with the mode "Local Subscription Message Trigger" can be added on the "Custom Quick Functions" page to subscribe to this topic, where the grouped data can be processed within the quick function.
- Packet Data Polling Interval: The polling period for group packet data.
- Millisecond Data uploading: How many times the group packet data is polled, it is reported uniformly.
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connect Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Rack/Slot mode:
- I: Input register
- Q: Output register
- M: Internal register
- DB: Data register
- I: Input register
- Q: Output register
- M: Internal register
- V: Data register
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- BCD16:16-bit BCD code
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
PPI
PPI (Point-to-Point Interface) is a serial communication interface protocol developed by Siemens Corporation to connect the Siemens S7 series programmable logic controller (PLC) and its peripheral devices. PPI is mainly used for simple data transmission and communication tasks, such as connecting HMI (Human-Machine Interface), programming devices, and other external devices.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select PPI
- Station Number: Consistent with the device, range 0-255
- Communication mode: support RS485 and RS232, default RS485
- Polling period: It is the time interval of data collection (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable multi-polling cycle: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Communication time setting:
- Communication Interval Time: the interval time of packet interaction, that is, after receiving the response of the device, it will wait for a communication interval before sending the next request packet.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address Type:
- I: Input register
- Q: Output register
- M: Internal register
- V: Data register
- Address: The address of the measurement point.
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- BCD16:16-bit BCD code
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
*PPI over TCP
"PPI over TCP" refers to the communication mode of transmitting PPI (Point-to-Point Interface) data over TCP/IP network. In traditional industrial automation systems, PPI is usually connected to Siemens S7 series programmable logic controllers (PLCS) and their peripheral devices through serial interfaces (such as RS485). However, with the development of industrial networks, more and more applications begin to use TCP/IP networks to replace the traditional serial connection for remote access and data exchange.
Adding a controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select *PPI over TCP
- Station No: The station number of the device, in the range 0-255
- IP Address: The IP address of the device
- Port: The port information of the device
- Polling Interval: It is the time interval of collecting data (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connection Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: The address of the measurement point. Example: I1, Q1
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- BCD16:16-bit BCD code
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
*WebApi
Siemens' Web API (Web Application Programming Interface) is an HTTP-based interface for communication and data exchange with Siemens' industrial automation equipment and systems. It allows developers to access and manipulate data and functions on Siemens devices through network connections, enabling the monitoring, control, and integration of automation systems.
Adding controllers
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Controller Protocol: Select *WebApi
- IP Address: The IP address of the device
- Port: The port information of the device
- Polling Interval: It is the time interval of collecting data (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Advanced Settings:
- Timeout Settings:
- Timeout: The timeout time for the device to respond after the reading request is initiated to the device when the measurement point is collected. If the device does not respond to the reading request within the set collection timeout time, it is still the failure of this collection.
- Connection Timeout: the timeout time for establishing the connection.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Address: The address of the measurement point. Example: I1, Q1
- Data type: Measuring point data type, including:
- BIT: 0 or 1
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- BCD16:16-bit BCD code
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- ULONG: 64-bit unsigned integer
- LONG: 64-bit signed integer
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
Simple driver protocol
One of the distinguishing features of industrial automation is "fragmentation". This feature brings a lot of work and obstacles to digital work. In industry, there is such a kind of equipment:
A large number of models;
The function of a single device (from the perspective of communication) is relatively simple, the number of data (measuring points) is small, and the need for read and write fetch instructions is not many;
The communication protocol is question-answering, that is, "request-response" model;
Each model has its own unique communication protocol, which is usually a relatively simple parsing of binary bytes;
The length of the packet is generally less than 100 bytes, and the parsing is relatively simple for engineers to understand;
Simple Drive protocol is a general data acquisition protocol, which can solve the above problems.
Easy COM
Add controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select Easy COM
- Endpoint: Support RS485 and RS232, default use RS485
- Polling Interval: It is the time interval of data collection (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Command List:
- Read data: Enabled by default
- Read Command: Hex formulates long request packet, the dynamic data part of the packet needs to be filled with 00
- Response Length: The length of the response packet
- Response header check:
- Head Length: The length in bytes of the header of the packet
- Expect Head: The hexadecimal value of the header of the desired packet
- Start Byte: The number of bytes in the packet in which the content of the start check is located
- End Byte: The length of the check content
- Check Method: support CRC16, SUN16, SUM8, default use CRC16
- Check Byte order: Support "Consistent with the controller" and " As opposed to the controller ". If SUM8 is selected for validation, this option is not present. Controller endianness is configured in advanced settings
- Write Command: Hex formulates long request packet, the dynamic data part of the packet needs to be filled with 00
- Add Parity:
- Check Method: Support CRC16, SUN16, SUM8, default is CRC16
- Start Byte: Start from the first byte to calculate the check value
- End Byte: The number of bytes to check from the start byte
- Check Byte Order: supports "Consistent with the controller" and " As opposed to the controller ". If SUM8 is selected for validation, this option is not present. Controller endianness is configured in Advanced Settings
- Response Length: The length of the response packet after the data is written. Range 1-256 bytes
- Response header Check:
- Head Length: The length of the header of the packet
- Expect head: The hexadecimal value of the header of the desired packet
- Start Byte: The number of bytes in the packet in which the content of the start check is located
- End Byte: The length of the check content
- Check Method: support CRC16, SUN16, SUM8, default use CRC16
- Check Byte Order: Support "consistent with the controller" and "contrary to the controller". If SUM8 is selected for validation, this option is not present. Controller endianness is configured in Advanced Settings
Advanced Settings:
- Byte Order: Two are supported, "High byte first" and "Low Byte first"
- Timeout: The timeout time of the device response after the read request is initiated to the device when the measurement point is collected. If the device does not respond to the read request within the set acquisition timeout time, it is still the acquisition failure.
- Communication time setting:
- Communication Interval Time: the interval time of packet interaction, that is, after receiving the response of the device, it will wait for a communication interval before sending the next request packet.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Measuring Point Byte Order:support " Consistent with the controller" and " As opposed to the controller". Controller endianness is configured in Advanced Settings
- Conversion Method:support "HEX2DEC(hexadecimal to 10)", "BCD2DEC(BCD code to 10)", "IEEE754(standard floating point number)", "data minus 33H to take BCD", "data minus 33H to take HEX", "data minus 33H to take ASCII"
- Data type: Measuring point data type, including:
- BYTE: an 8-bit unsigned number
- SINT: 8-bit signed number
- BCD16:16-bit BCD code
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating-point number
- DOUBLE: 64-bit floating point number
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Read Data Offset Address: The starting address of the current measurement point in the packet. The address of the first byte of the packet is 0, and so on.
- Read Data Byte Length: The byte length of the current measurement point in the packet
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
Easy TCP
Add controller
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select Easy TCP
- IP Address: The IP address of the communication peer
- Port: Port information of the communication peer
- Polling Interval: It is the time interval of data collection (seconds), for example, it is set to 10S, then all the measurement points under the controller are polled every 10S
- Enable Multiple Polling Interval: Once enabled, you can configure an additional polling cycle and select certain measurement points under the controller to use the polling cycle. This function can be used to distinguish the measurement points that need high frequency and low frequency acquisition, and make efficient use of gateway and PLC performance.
- Polling Interval 2: An additional polling cycle (in seconds) that needs to be set when multiple polling cycles are enabled.
- Description: You can add comment information to this controller
Command List:
- Read data: Enabled by default
- Read Command: Hex formulates long request packet, the dynamic data part of the packet needs to be filled with 00
- Response Length: The length of the response packet
- Response header check:
- Head Length: The length in bytes of the header of the packet
- Expect Head: The hexadecimal value of the header of the desired packet
- Start Byte: The number of bytes in the packet in which the content of the start check is located
- End Byte: The length of the check content
- Check Method: support CRC16, SUN16, SUM8, default use CRC16
- Check Byte order: Support "Consistent with the controller" and " As opposed to the controller ". If SUM8 is selected for validation, this option is not present. Controller endianness is configured in advanced settings
Write Date:
- Write Command: Hex formulates long request packet, the dynamic data part of the packet needs to be filled with 00
- Add Parity:
- Check Method: Support CRC16, SUN16, SUM8, default is CRC16
- Start Byte: Start from the first byte to calculate the check value
- End Byte: The number of bytes to check from the start byte
- Check Byte Order: supports "Consistent with the controller" and " As opposed to the controller ". If SUM8 is selected for validation, this option is not present. Controller endianness is configured in Advanced Settings
- Response Length: The length of the response packet after the data is written. Range 1-256 bytes
- Response header Check:
- Head Length: The length of the header of the packet
- Expect head: The hexadecimal value of the header of the desired packet
- Start Byte: The number of bytes in the packet in which the content of the start check is located
- End Byte: The length of the check content
- Check Method: support CRC16, SUN16, SUM8, default use CRC16
- Check Byte Order: Support "consistent with the controller" and "contrary to the controller". If SUM8 is selected for validation, this option is not present. Controller endianness is configured in Advanced Settings
Advanced Settings:
- Byte Order: Two are supported, "High byte first" and "Low Byte first"
- Timeout: The timeout time of the device response after the read request is initiated to the device when the measurement point is collected. If the device does not respond to the read request within the set acquisition timeout time, it is still the acquisition failure.
- Communication time setting:
- Communication Interval Time: the interval time of packet interaction, that is, after receiving the response of the device, it will wait for a communication interval before sending the next request packet.
- Communication Message Settings:
- Store Communication Messages: The controller with this function enabled will store communication messages. The storage path and number can be set in the "Default Parameter" of the "Parameter Settings" page. If you need to download the stored communication message, you can enter the "Realtime Communication Message" page of the specified controller in the "Measure Monitor" page, and click the "Download" button to download.
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Measuring Point Byte Order:support " Consistent with the controller" and " As opposed to the controller". Controller endianness is configured in Advanced Settings
- Conversion Method:support "HEX2DEC(hexadecimal to 10)", "BCD2DEC(BCD code to 10)", "IEEE754(standard floating point number)", "data minus 33H to take BCD", "data minus 33H to take HEX", "data minus 33H to take ASCII"
- Data type: Measuring point data type, including:
- BYTE: an 8-bit unsigned number
- SINT: 8-bit signed number
- BCD16:16-bit BCD code
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating-point number
- DOUBLE: 64-bit floating point number
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Write: Only write, not read
- Read Data Offset Address: The starting address of the current measurement point in the packet. The address of the first byte of the packet is 0, and so on.
- Read Data Byte Length: The byte length of the current measurement point in the packet
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
- Enable Package Reporting: This field is visible when the controller enables group packet reporting. When the measuring point is enabled, it will report data in accordance with the packet reporting logic set by the controller in addition to the group reporting data
Virtual controller
The virtual controller is mainly a data display controller designed for secondary development equipment acquisition by the gateway. The data collected by the secondary development App can be transmitted to the internal gateway through the internal MQTT message bus, and the data is displayed in the virtual controller's measurement point by calling the script API that writes the controller's measurement point value.
Adding controllers
- Name: The name of the controller, which is unique in the controller list for the entire gateway
- Protocol: Select the virtual controller
- Status expiration time: If set to greater than 0, the state will be automatically updated to offline if no new message is received by the virtual controller or measurement point within the specified time; If it is equal to 0, the controller will never show offline after it has been online.
- Description: You can add comment information to this controller
Adding measurement points
- Measuring Point Name: The name of the measuring point (the name of the measuring point cannot be repeated under the same controller)
- Data type: Measuring point data type, including:
- BYTE: An 8-bit unsigned number
- SINT: 8-bit signed number
- BCD16:16-bit BCD code
- WORD: 16-bit unsigned integer
- INT: 16-bit signed integer
- DWORD: 32-bit unsigned integer
- DINT: 32-bit signed integer
- FLOAT: 32-bit floating point number
- DOUBLE: 64-bit floating point number
- STRING: 8-bit string
- Decimal Places: The length of the data after the decimal point when the data type is FLOAT or DOUBLE ,the maximum is 6 digits
- Size: The length of the STRING when the data type is String
- Character Encoding Format: ASCII, UTF-8, UTF-16 little endian, UTF-16 big endian, GB2312 little endian, GB2312 big endian. Only data type selection STRING is valid.
- Read Bit Data: The value of any bit data in the integer can be read when enabled.
- Register Bit: When the bitwise value is enabled, the bit offset of the measuring point when reading the bit data.
- Negative Value: When the bitwise value is enabled or the data type is BIT, you can choose whether to negate the result of the read.
- Value mapping:When enabled, maps the 0 and 1 values of a BIT point to False and True
- Read and write permissions:
- Read: read-only, not writable
- Read/Write: Readable and writable
- Mode:
- Periodic: Periodically reports data according to the reporting period of the group it belongs to
- Onchange: When the value of the measuring point changes, the data will be reported periodically according to the reporting period of the group
- Never: Only used locally, no need to upload data from the cloud
- Onchange Deadzone: When the upload mode is Onchange, you can set the value change within a certain range to be treated as no change. If the data has configuration data operation, the value after operation is used to detect whether the value change exceeds the dead zone.
- Unit: Measuring point unit
- Description: Description of the measuring point
- Group: The group to which the measuring point belongs
- Store Historical Data: When enabled, the historical data table will be generated with the name of the group to which the measurement point belongs, and the historical data will be stored according to the storage strategy set by the group. The stored historical data can be exported as CSV files or obtained by calling Python API.
- Data Calculation: When the data type of the measurement point is not BIT or STRING, it supports simple operation processing through data operation, and the processed data value can be reported to the cloud platform. The value mapped to the protocol conversion (Modbus Slave or OPC UA Server, etc.) defaults to the original data value collected rather than the calculated data value
- No: No computation is performed, the raw data value collected is used
- Ratio Conversion: the collected data value is mapped to a data value in the range of the upper and lower limits of the ratio in equal proportion to the data value, such as mapping the data collected in the sensor to the actual temperature and humidity. The calculation formula is the calculated data value = (upper limit of proportion - lower limit of proportion)/(upper limit of data - lower limit of data) * (original data value - lower limit of data) + lower limit of proportion
- Decimal Places: The number of decimal places that need to be retained after the operation
- Data High Limit: The upper limit of the data of the measuring point
- Data lower Limit: the lower limit of the data at the measuring point
- High Limit Of Proportion: the upper limit of the data after the proportion operation
- Lower Limit Of Proportion: The lower limit of the data after the scale operation
- Offset and Zoom: calculate the original data value according to the multiplier and offset. The formula is the calculated data value = (original data value * multiplier) + offset
- Decimal Places: The number of decimal places to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- Bit Trunction: Intercepts a segment of data in the original data as a data value. FLOAT type measuring points do not support this operation
- Start Bit: The bit offset at which the intercept of the original data begins
- End Bit: The bit offset that ends the interception of the original data
- PT/CT: Calculate the original data value according to the magnification, offset, PT and CT, the formula is [(original value * magnification)+ offset]*PT*CT
- Decimal Places: The number of decimal places that need to be retained after the operation
- Magnification: The multiplier that needs to be scaled up or down
- Offset: The data value that needs to be increased or decreased after the multiplier operation
- PT: Additional PT multiplier
- CT: Additional CT magnification
- Value mapping: Configurable measuring points for specific values converted to other values.
- Source Value: The raw value of the collected measuring point.
- Target Value: The expected value of the converted measuring point.
Modbus TCP Slave
Modbus TCP Slave configuration
In the Modbus TCP Slave configuration page,
enable Modbus TCP Slave, the interface is shown as follows:
Modbus TCP Slave configuration interface
parameters:
- Port: The port number of modbus TCP,
support 1-65535, the default is 502.
- 16-bit integer byte order: The gateway is
fixed to AB byte order
- 32-bit integer byte order: The gateway is
fixed to ABCD byte order
- 32 bit float byte order: The gateway is
fixed to ABCD byte order
- 64-bit integer byte order: The gateway is fixed
to ABCDEFGH byte order
- Max-Connection: 1-32 supported, default is
5 connections.
- Mapping value Settings: Support Data
original value and Data caculation value. The default is Data original value (Data
original value: the actual value collected by the southbound device; Data caculation
value: the value after the gateway data operation)
After configuring Modbus TCP Slave
parameters, click "Submit" button to enable Modbus TCP Slave
function. In the Status of Modbus TCP Slave page, you can view the running
status and connected device information.
Click the "Add" button in the
interface that pops up to configure a mapping table with a different slave
address (Note: map table name and slave address are not
repeatable)
The figure is to add a Modbus mapping table
with name 2 and slave address 2
After the successful addition, the
interface displays as shown in the figure:
Click the "Edit" button to modify
the slave address on the mapping table of the current page. When the number of
mapping tables of the page is greater than 2, click the "Delete"
button to delete the mapping table. Delete mapping table 2 as shown below:
The following figure is adding measuring points to the Modbus TCP Slave mapping table:
- Description of the parameters to add the
mapping:
- Controller: Southbound controller device
- Measure: The measuring point in the
southbound controller
- Read/Write: The same as the read and write
permissions of the measurement point in the southbound controller (cannot be
modified)
- Original Data Type: Same as the data type
of the point in the southbound controller (immutable)
- Mapping Data Type: The data type of the
measurement point in the Modbus TCP Slave
- Start Mapping Address: the start address of
the register of the measure point in Modbus TCP Slave
- Mapping address: Automatically calculated and displayed according to
the starting mapping address and data type.
The following figure is batch adding
measurement points to the Modbus TCP Slave mapping table:
Introduction to batch adding mapping
parameters:
- Start Mapping Address: the start address of
the register of the currently selected measurement point in Modbus TCP Slave
- Mapping Address: According to the starting
mapping address, the selected measurement point and the data type of the
measurement point, the current map address range of the measurement point is
calculated and displayed
- Mapping Data Type: The data type of the
current measurement point in Modbus TCP Slave can be configured.
IEC 104 Server
IEC 104 Server configuration
On the IEC 104 Server configuration page,
after enabling IEC 104 Server, the interface is as shown below:
IEC 104 Server configuration interface
parameters description:
Basic Settings:
- COT Size: The length of the transmission
reason in bytes, the COT field is used to identify the transmission reason. 1
and 2 are supported, the default is 2
- ASDU Size: The length of the application
service data unit, which is the length of the CA public address, the ASDU field
is used to distinguish between different substations on this link. 1 and 2 are
supported, the default is 2
- Connection mode:
- Port Number:
Configure the port of the TCP server
- Server IP
address/domain name: Configured in client mode, TCP server address or domain
name you want to connect to
- Port Number: The port of the server
- Mapping Value Setting: Support Data
original value and Data caculation value. The default is Data original value (Data
original value: the actual value collected by the southbound device; Data caculation
value: the value after the gateway data caculation)
- Server list: In general, the station
address of the link address field and the Application Service Data Unit (ASDU)
public address can be set to the same value. In some cases, there can be more
than one application service data unit (ASDU) public address under the station
address of one link layer address area, such as: a substation collects
information of several nearby satellite stations and then transmits it to the
main station. In this case, there can be more than one common address of the
application service data unit. At this point, you can add multiple servers here
to represent multiple sub-stations. Here's an example of adding an ASDU address
of 2 (Note: Addresses are not repeatable) :
If the serial number in the Server list is
greater than 2, then you can remove the unwanted ASDU address. Here's how to
delete an ASDU address with serial number 1:
Advanced Settings:
- Enable Spontaneous reporting: When enabled,
the slave will actively send data to the master
- K Value: The maximum number of I format
(information) APDU (k) that has not been acknowledged. Range 1-32, default 12.
- W Value: Acknowledgement by the receiver
upon receipt of w I format (information) APdus, range 1-32, default 8.
- T0 Timeout (S) : T0 timeout is the timeout
that the master waits for a response from the slave after sending the start
frame. If no response frame is received from the slave within the T0 timeout
period, the master will consider the communication failed and act accordingly.
Range 1-3000, default is 30 in seconds.
- T1 Timeout (S) : t1 stipulates that after
the sender sends an I format packet or U format (control) packet, it must be
acknowledged by the receiver within the time of t1, otherwise the sender
believes that the TCP connection has a problem and should re-establish the
connection. Range 1-3000, default is 15 in seconds.
- T2 Timeout (S) : t2 stipulates that after
receiving an I format packet, if the receiver does not receive a new I format
packet after t2 time, it must send an S format (monitoring) frame to the sender
to acknowledge the received I format packet. Range 1-3000, default is 10, in
seconds. Note: T2 < T1
- T3 Timeout (S) : t3 stipulates that the
dispatcher or the sub-station RTU will retrigger the timer t3 every time it
receives an I frame, S frame or U frame. If no packet is received within t3, it
will send a test link frame to the other side. Range 1-3000, default is 20, the
unit is seconds. Note: T3 > T1
- Maximum Connection: 1-32 supported, 5 by
default
- Time Setting: Only local time is supported
- Byte Order: Fixed to ABCD
After the IEC 104 Server parameters are
configured, click the "Submit" button to enable the IEC 104 Server
function. In the Status page of IEC 104 Server, you can view the operating
status and connected device information.
Configure the IEC 104 Server Mapping Table
The following figure is to add the measurement points to the IEC 104
Server mapping table (note: read-only measurement points can be mapped only once, read-write measurement
points can be mapped twice) :
Introduction to adding mapping parameters:
- Controller: Southbound controller device
- Measure: The measuring point in the southbound controller
- Read/Write: The same as the read and write permissions of the
measurement point in the southbound controller (cannot be modified)
- Original Data Type: Same as the data type of the point in the
southbound controller (immutable)
- Type ID: Shows the supported type ID based on the measurement point
type
Display based on point data permissions and
data types:
- Single-Point Information (read-only or read-write points, supported
point type: BIT) :
[1] M_SP_NA_1
[30] M_SP_TB_1
- Double-Point Information (read-only or read-write points, supported
point types: all point types except BIT,FLOAT and STRING) :
[3] M_DP_NA_1
[31] M_DP_TB_1
- Step Position Information (read-only or read-write points are
acceptable, supported point types are BYTE,SINT) :
[5] M_ST_NA_1
[32] M_ST_TB_1
- Bitstring (32 bit) (read-only or read/write point, support site
types: BYTE, SINT, WORD, INT, DWORD, DINT, BCD) :
[7] M_BO_NA_1
[33] M_BO_TB_1
- Measured Value (Normalized) (read-only or read/write point, support
site types: BYTE, SINT, WORD, INT, DWORD, DINT, FLOAT, BCD) :
[9] M_ME_NA_1
[21] M_ME_ND_1
[34] M_ME_TD_1
- Measured Value(Scaled) (read-only or read-write points, supported
point types: BYTE,SINT,WORD,INT,BCD) :
[11] M_ME_NB_1
[35] M_ME_TE_1
- Measured Value (Short Float) (read-only or read/write point, support
site types: BYTE, SINT, WORD, INT, DWORD, DINT, Float, BCD) :
[13] M_ME_NC_1
[36] M_ME_TF_1
- Integrated the Totals (read-only or read/write point, support site
types: BYTE, SINT, WORD, INT, DWORD, DINT, BCD) :
[15] M_IT_NA_1
[37] M_IT_TB_1
- Parameter (read-only or read/write point, support site types: BYTE,
SINT, WORD, INT, DWORD, DINT, FLOAT, BCD) :
[110] P_ME_NA_1
[111] P_ME_NB_1
[112] P_ME_NC_1
- Single Command (read and write points only, BIT type supported) :
[45] C_SC_NA_1: Single remote command
[58] C_SC_TA_1: Single remote command with
time tag.
- Double Command (read and write points only, all points except
BIT,FLOAT and STRING are supported) :
[46] C_DC_NA_1
[59] C_DC_TA_1
- Regulating Step Command (only read and write points are supported,
supported point types: BYTE,SINT) :
[47] C_RC_NA_1
[60] C_RC_TA_1
- Set point command - Measured Value (Normalized) (measuring point
only supports, speaking, reading and writing, and support the site types: BYTE,
SINT, WORD, INT, DWORD, DINT, FLOAT, BCD) :
[48] C_SE_NA_1
[61] C_SE_TA_1
- Set point command-Measured Value(Scaled) (read and write points only
supported, supported point types: BYTE,SINT,WORD,INT,BCD) :
[49] C_SE_NB_1
[62] C_SE_TB_1
- The Set point command - Measured Value (Short Float) (measuring
point only supports, speaking, reading and writing, and support the point of
types: BYTE, SINT, WORD, INT, DWORD, DINT, Float, BCD) :
[50] C_SE_NC_1
[63] C_SE_TC_1
- Bitstring command (32 bit) (only point support, speaking, reading
and writing, and support the site types: BYTE, SINT, WORD, INT, DWORD, DINT,
BCD) :
[51] C_BO_NA_1
[64] C_BO_TA_1
- Mapping Data Types: Datatypes mapped in IEC 104 Server
- ASDU Address: ASDU
address selection in the Server list
- Start IOA: Identifies the address of the information object in the
communication transmission.
- Mapping Address: Determined by the type ID and the starting IOA
value
The following figure is batch adding
measurement points to the IEC 104 Server mapping table
Batch adding mapping interface parameters:
- ASDU address: Select according to the ASDU
address added in the server list when configuring
- Type ID: Based on the type ID, the
supported measurement point information is displayed
Refer to the type ID in the introduction to
Add Mapping parameters for specific types.
- Start IOA: Starting mapping address
- Mapping Address: According to the starting
mapping address, the currently added mapping address range of the measurement
point is displayed
- Mapping Data Type: You can configure the
data type of the current measuring point in IEC 104 Server.
OPCUA Server
OPCUA Server configuration
On the OPCUA Server configuration page, after
enabling OPCUA Server, the interface is as shown below:
OPCUA Server configuration interface
parameters description:
- Port: OPCUA server's port number, range: 1-65535
- Max-Connection: Maximum number of client connections supported,
range: 1-32
- Anonymous: When anonymous login is disabled, two configuration items
"Username" and "Password" will be displayed
- UserName: Set the username used by the client connection
- Password: Set the password used for the client connection
After the username and password are configured, the client
connection will not be able to connect to the server without entering the
correct username and password.
- Server Certificate: After importing, OPCUA server will authenticate
the client with the certificate key
- Server Private Key: After import OPCUA server will authenticate the
client with the certificate key
- Identifier Type: Numeric and String are supported, and String type
is used by default
- Mapping Value Settings: Data original value and data caculation
value are supported. The default is Data original value (Data original value:
the actual value collected by the southbound device; Data caculation value: the
value after the gateway data operation)
After configuring the OPCUA Server
parameters, click the "Submit" button to enable the OPCUA Server
function. On the status page of OPCUA Server, you can view the operating status
and connected device information.
Configure the OPCUA Server Mapping Table
The following figure is to add measurement
points to the OPCUA Server mapping table:
- Mapping Data Type: The current measurement point is mapped to the
data type in OPCUA Server
Check the point you want to add to the
mapping table. Finally, click "OK" to add the point to the mapping
table
Modbus RTU Slave
Modbus RTU Slave configuration
In the configuration page of Modbus RTU
Slave, after enabling Modbus RTU Slave, the interface is as shown below:
Modbus RTU Slave configuration interface
parameters:
- Communication mode: support RS485 and RS232, the default is RS485
- Baud Rate: can be configured in the "Parameter Settings"
page
- Data Bits: can be configured on the "Parameter Settings"
page
- Parity: can be configured in the "Parameter Settings" page
- Stop Bits: can be configured in the "Parameter Settings"
page
- 16-bit integer byte order: The gateway is fixed to AB byte order
- 32-bit integer byte order: The gateway is fixed to ABCD byte order
- 32-bit float byte order: The gateway is fixed to ABCD byte order
- 64-bit integer byte order: The gateway is fixed to ABCDEFGH byte
order
- Mapping value setting: support Data original value and Data caculation
value. The default is Data original value (Data original value: the actual
value collected by the southbound device; Data caculation value: the value
after the gateway data operation)
After configuring Modbus RTU Slave
parameters, click "Submit" button to enable Modbus RTU Slave
function. In the status page of Modbus RTU Slave, you can view the running
status information.
Configure the Modbus RTU Slave Mapping Table
Configuring the Modbus RTU Slave mapping
table can be referred to Configuring the "Modbus TCP Slave mapping table"
IEC 101 Server
IEC 101 Server configuration
On the IEC 101 Server configuration page,
after enabling IEC 101 Server, the interface is as shown below:
IEC 101 Server
configuration interface parameters description:
Basic Settings:
- Communication Mode: Support RS232,RS485,TCP Transparent transmission
- Link Mode: support Balanced Transmission and Unbalanced
Transmission, Unbalanced Transmission only supports one side of the
communication at the same time to send data, belongs to half duplex, suitable
for RS485 scenario, Balanced Transmission can support both sides of
communication to send data at the same time, belongs to full duplex, suitable
for RS232 scenario
- Protocol Mode: IEC60870-5-101 and DL/T634.5101. IEC60870-5-101 is
more suitable for international power automation systems, and DL/T634.5101 is
suitable for Chinese power systems.
- Link Address Size: 1 and 2 are supported. The number of bits or
bytes used to represent the address of a device in the link layer
- Link Address: A unique identifier used in the link layer to identify
a communicating device
- ASDU Size: The length of the application service data unit, that is,
the length of the CA public address, the ASDU field is used to distinguish
between different sub-stations on this link. 1 and 2 are supported, the default
is 2
- IOA Size: The length of the IOA determines the number and range of
monitoring points. 1, 2, and 3 are supported. The default is 3
- COT Size: The length of the transmission reason in bytes. COT field
is used to identify the transmission reason. 1 and 2 are supported. Default is
2.
- Mapping Value Settings: Support Data original values and Data caculation
values. The default is Data original value (Data original value: the actual
value collected by the southbound device; Data caculation value: the value
after the gateway data operation)
- Server List: In general, the station address of the link address
field and the Application Service Data Unit (ASDU) public address can be set to
the same value. In some cases, there can be more than one application service
data unit (ASDU) public address under the station address of one link layer
address area, such as: a substation collects information of several nearby
satellite stations and then transmits it to the main station. In this case,
there can be more than one common address of the application service data unit.
At this point, you can add multiple servers here to represent multiple
sub-stations. Here's an example of adding an ASDU address of 2 (Note: Addresses
are not repeatable) :
If the order number in the Server list is
greater than 2, then the unwanted ASDU address can be removed. (Server list serial number is greater than or equal to 1),
the following figure is to delete an ASDU address with serial number 1:
If the communication mode is selected TCP
transparent transmission parameter description:
- Heartbeat Retry Interval: The time interval for the server to send a
heartbeat packet and wait for a response from the client. The default is 10
seconds, ranging from 1-3600
- Keeplive Retry: The number of times the server attempts to resend a
heartbeat packet when it does not receive a response from the client. The
default is 5 retries, ranging from 1-100
- Heartbeat max idle time: The maximum time the server will allow a
connection to remain idle without receiving a response from the client. The
default is 100 seconds, ranging from 1-65535
- Serial Buffer Frame: The number of data frames received by the
system cache. The default is 4 frames. Range 1-4
- Packet Size: The length of each data frame in serial communication.
The default is 1024, and 1-1024 bytes are supported
- Force Transmit Timer: The time interval between each data frame in
serial communication. The default is 100 ms, and 10-65535 ms is supported
- Min Reconnect Interval: The minimum time interval to reconnect after
being disconnected. 15 seconds by default, 15-60 seconds is supported.
- Max Reconnect Interval: The maximum time interval to reconnect after
being disconnected. 15 seconds by default, 15-3600 seconds is supported
- Multi-server policy: Multiple data centers (or server centers) are
used in the system to handle TCP pass-through connections, and some policy is
used to manage the distribution and processing of these connections. The policy
supports parallel and polling modes, and the default is to use parallel.
- Send Access Request Message: The master station (or client) sends a
request to the remote device (or server) to establish a communication
connection. The purpose of this request packet is to request the remote device
to establish a connection with the master station for data exchange and
communication. Once enabled, the contents of the packet must be entered.
- Destination IP address: The destination IP address is the IP address
of the remote device or server, which is the network address of the receiver.
This IP address is used to send the packet to the correct destination so that
the remote device can receive and process this request and establish a
communication connection. The following is an example of adding the destination
IP address:
After the addition is complete, you can
edit and delete the destination address you added.
Advanced Settings:
- Enable Spontaneous: The device is able to proactively send data to
the master (or client) instead of waiting for the master to make a request. The
default is enabled.
- Link confirmation timeout: The maximum time you can wait for the
other party to confirm the connection while the connection is being
established. The default is 2000 milliseconds. Range 50-2147483647
- Idle Timeout: The maximum amount of time that a connection can wait
without data exchange after it has been established. The default is 10,000
milliseconds. Range 50-2147483647
- Time Setting: Only local time is supported
- Byte Order: Only ABCD format is supported
Once the IEC 101 Server parameters are
configured, click the "Submit" button to enable the IEC 101 Server
function. In the status page of IEC 101 Server, you can check the running
status.
Configure the IEC 101 Server Mapping Table
The mapping table of IEC 101 Server
supports three types: Telemetering, Telesignalling and Telecontrol.
- Telemetering: Telemetering refers to the
function of obtaining continuous measurement values from remote sites. These
measurements can include real-time values of parameters such as current,
voltage, power, and energy. The IEC 101 Server can send query commands to
remote sites to obtain telemetry values for specific equipment or systems and
monitor and record them as needed.
- Telesignalling: Telesignalling refers to
the function of obtaining discrete status information from remote sites. This
information can include the on/off status of equipment, alarm states, and more.
The IEC 101 Server can send query commands to remote sites to obtain the
telesignalling status of specific equipment or systems and monitor and record
them as needed.
- Telecontrol: Telecontrol refers to the
capability to control devices or systems at remote sites. The IEC 101 Server
can send control commands to remote sites, such as turning switches on/off,
adjusting equipment parameters, etc., to achieve remote control of remote
devices.
The following figure shows the addition of
measurement points to the IEC 101 Server mapping table
Introduction to adding mapping parameters:
- Controller: Southbound controller device
- Measure: Measuring point in the southbound controller (Note:
telemetry only supports measuring points of non-BIT data type, telemetry and
remote control only support measuring points of BIT data type)
- Read/Write: the same as the read and write permissions of the
measurement point in the southbound controller (cannot be modified)
- Original Data Type: Same as the data type of the point in the
southbound controller (immutable)
- Mapping Data Type: The data type of the measurement point in IEC 101
Server
- ASDU Address: ASDU address selection in the Server list
- Type ID: The type ID of the Telemetering is fixed to: [13]
M_ME_NC_1; The type ID of Telesignalling is fixed: [1] M_SP_NA_1; The type ID
of the Telecontrol is fixed: [45] C_SC_NA_1
- Start IOA: Identifies the address of the information object in the
communication transmission.
- Mapping Address: Determined by the type ID and the starting IOA
value
The following figure is batch adding
measurement points to the IEC 101 Server mapping table
Batch adding mapping interface parameters
(batch added measurement points only show the measurement points that meet the
type ID and meet the search criteria) :
- ASDU Address: ASDU address selection in the Server list
- Type ID: The type ID of the Telemetering is fixed to: [13]
M_ME_NC_1; The type ID of Telesignalling is fixed: [1] M_SP_NA_1; The type ID
of the Telecontrol is fixed: [45] C_SC_NA_1
- Start IOA: Identifies the address of the information object in the
communication transmission. The address of the first check point checked and
the addresses of the remaining check points sorted from top to bottom
- Mapping Address: According to the starting mapping address, the
current mapping address range of the measurement point is calculated and
displayed
SL651
SL651 configuration
On the configuration page of SL651, after
enabling SL651, the interface looks like the following picture:
IEC 101 Server
configuration interface parameters description:
- Central Station Address: A unique identifier to distinguish each
central station, the default is 1, range 1-225
- Telemetry Address: Enter a 10-digit telemetry address consisting of
a borough number and a station number
- Telemetry Type: supports "500 Tons/Day or more",
"100-500 Tons/day" and "Below 100 Tons/Day". By default
"Below 100 Tons/Day" is used
- Password: The connection password for the central station, no longer
than 4 characters
- Mapping Value Settings: support Data original value and Data caculation
value. The default is Data original value (Data original value: the actual
value collected by the southbound device; Data caculation value: the value
after the gateway data caculation)
- Central Station List: (Add at least one central station)
- IP address: The IP address of the central station
- Port: Port information of the central station
- Enable whole slice reporting: In every whole slice (i.e. 15 minutes)
time interval, the data is automatically reported.
- Reporting Cycle: The default reporting period is 60 seconds. With
full reporting enabled, the default reporting period will be 900 seconds. Range
1-86400 seconds
- Communication Timeout: Communication timeout is usually the maximum
time you can wait for a response from the other party while establishing a
communication connection or sending data. If no response is received from the
other party within the set timeout period, the communication is usually
considered to have failed or expired. The default is 5 seconds, ranging from
1-3600 seconds
After configuring the SL651 parameters,
click the "Submit" button to enable the SL651 function. On the status
page of the SL651, you can view the running status and connected device
information.
Configure the SL651 Mapping Table
The following figure is to add the
measurement points to the SL651 mapping table (Note: Feature type measurement
points are configured in order to be added to the mapping table.)
The introduction to the parameters of the Add
Map interface is as follows:
- Mapping Data type: The data type in SL651 can be configured
according to the actual situation.
- Element Type: Select measurement points based on their application
scenarios.
HJ212 Clinent
HJ212 Client Config
In the Configuration page of HJ212 Client,
after enabling HJ212 Client, the interface is as shown below:
HJ212 Client Configuration interface
parameters description:
- Mapping Value Setting: support Data original value and Data caculation
value. The default is Data original value (Data original value: the actual
value collected by the southbound device; Data caculation value: the value
after the gateway data caculation)
- Platform Settings:
After clicking the "Add" button,
the following screen will be displayed:
Add platform parameter introduction:
- Platform Name: Custom do not repeat the name
- Platform IP Address: The IP address of the server
- Platform Port: The port number of the server
- MN Coding: Unique identification of the device with a maximum
support of 24 characters
- Password: A security credential for authentication that cannot
exceed 24 characters
- Communication Mode: Only Upload Mode is supported
- TCP Heartbeat Interval: In TCP communication, the time interval
between sending heartbeat packets
- TCP Reconnect Interval: The time interval between reattempts to
establish a connection after a TCP connection has been dropped
Data Settings:
Add Dataset parameters Introduction:
- DatasetName: Custom non-duplicate name
- System coding: The system code specified according to the monitoring
system, such as 21 for surface water quality detection. A maximum of two
characters is supported
- Upload Interval: The time interval between reports
After configuring the HJ212 Client
parameters, click the "Submit" button to enable the HJ212 Clinet
function. In the HJ212 Clinet status page, you can view the running status and
connected device information.
Configure the HJ212 Client Mapping Table
The following figure is to add the
measurement points to the HJ212 Client mapping table (Note: The mapping table
can only be added if the measurement points are filled in for both the
monitoring factor and the data set. If only one item is filled in, click the
"Confirm" button and an error will be reported)
Description of
parameters for adding mapping:
- Mapping Data Type: The data type in HJ212
Client
- Monitoring Factor Coding: it is used to
distinguish different detection parameters or detection factors, and match
specific detection parameters according to the actual significance of the
measurement points
- Dataset: Select according to the dataset
at the time of configuration
BACnet IP Server
BACnet IP Server Configuration
In the BACnet IP Server Configuration page,
after enabling BACnet IP Server, the interface is as shown below:
BACnet IP Server Configuration interface
parameters description:
- Port: The port
number used by the gateway to enable this server
function
- Local Device ID: A unique identifier for each BACnet device in the
network it is in
- Enable BBMD (allows devices to communicate by broadcast mode, thus
enabling communication across network segments) :
- BBMD IP: The IP address of the device used to manage BACnet
broadcast communication, the BBMD device is responsible for managing the
routing and forwarding of BACnet broadcast messages to ensure that broadcast
messages can be transmitted across different network segments.
- BBMD TTL: The maximum number of transmission hops or lifetime
allowed for a BACnet broadcast message when it crosses the network. It is used
to limit the transmission range of a broadcast message in the network and
prevent the message from spreading without limit, thus reducing network load
and improving security
- Mapping value setting: support Data original value and Data caculation
value. The default is Data original value (Data original value: the actual
value collected by the southbound device; Data caculation value: the value
after the gateway data caculation)
Configure the BACnet IP Server Mapping Table
The following figure is to add measurement
points to the BACnet IP Server Mapping Table
Add mapping interface parameters:
- Controller: southbound controller device
- Measure: The measuring point in the southbound controller
- Read/Write: The same as the read and write permissions of the
measurement point in the southbound controller (cannot be modified)
- Original Data Type: Same as the data type of the point in the
southbound controller (immutable)
- Object Type: When the data type is BIT, it can be mapped to the
following types: Digital Input, Digital Output, Digital Value. Data types other
than BIT and STRING can be mapped to the following types: Analog Input, Analog Output,
Analog Value, Multi-state Input, Multi-state Output, Multi-state Value.
- Mapping Data Type: The data type of the measurement point in BACnet
IP Server
- Instance Number: Used to identify different object instances in the
network, ranging from 0-511
- Mapping Address: Automatically generated based on object type.
The following figure is batch adding
measurement points to the BACnet IP Server mapping table:
Introduction of parameters for Batch Add Map:
- Object Type: Select from the drop-down box. According to the
selected object type, the following table will show the matching measurement
points
- Instance Number: The instance number of the starting point of the
selected point
- Mapping Address: According to the object type, the instance number
and the selected measurement point, the corresponding mapping address range is
automatically generated
- Mapping Data Type: The data type of the measurement point in BACnet
IP Server
DNP3 Outstation
DNP3 Outstation Configuration
On the DNP3 Outstation Configuration page,
after enabling DNP3 Outstation, the interface is as follows:
DNP3 Outstation Configuration interface
parameters:
Basic Settings:
- Communication Mode: Support TCP and UDP, default use TCP
- Local Port: The Outstation usually listens to a local port number in
order to communicate with the master station
- Select UDP as the communication method:
- Remote IP Address: The IP address to which the UDP datagram is sent
- Remote Port: The destination address port from which the UDP
datagram is sent
- Slave Address: A unique identifier for a device or site in the DNP3
communication network
- Master address: A unique identifier for the master station in the
DNP3 communication network that is responsible for sending requests and control
commands
- Mapping Value Setting: Support Data original value and Data caculation
value. The default is Data original Value (Data original value: the actual
value collected by the southbound device; Data caculation value: the value
after the gateway data operation)
Advanced Settings:
- Enable unsolicited response: When enabled:
- Unsolicited
confirm timeout: The timeout that the Outstation waits for the response of the
master after sending data to the master. If the Outstation does not receive a
response from the master within the timeout period, the Outstation may consider
the communication failed
- Data link confirm mode: When enabled:
- Data link response timeout: The link message timeout is the timeout
period for waiting for a link message after establishing a communication link
between the master station and the Outstation
- Data link max retry: After establishing a communication link, the
upper limit of the number of times the master or Outstation will attempt to retransmit
link messages if an acknowledgment message (ACK) is not received from the other
party.
- Maximum fragment size: The maximum number of bytes that can be
transmitted in a DNP3 frame.
- Application layer timeout: After the application layer sends data, the
timeout time to wait for the other party to reply
After configuring the DNP3 Outstation
parameters, click the "Submit" button to enable the DNP3 Outstation
function. On the status page of DNP3 Outstation, you can view the operating
status and connected device information.
Configure the DNP3 Outstation Mapping Table
Here's how to add a single measurement
point to the DNP3 Outstation mapping table:
Description of the parameters for adding
the mapping:
- Controller: Southbound controller device
- Measure: The measuring point in the southbound controller
- Read/write: The same as the read and write permissions of the
measurement point in the southbound controller (cannot be modified)
- Original Data Type: Same as the data type of the point in the southbound
controller (immutable)
- Register Type: When the measuring point data type is BIT, it can be
mapped to the following types: Digital Input, Digital Output; When the data
type is not BIT and STRING, it can be mapped to the following types: Analog Input,
Analog Output, Counter Input. When the address type is a digital input, the
group number is 1 and the variant is 1; When the address type is numeric
output, the group number is 10 and the variant is 2; When the address type is
analog input, the group number is 30 and the variant is 5. When the address
type is analog output, the group number is 40 and the variant is 1; When the
address type is counter input, the group number is 20 and the variant is 1.
- Mapping Data Type: The data type of the measurement point in the
DNP3 Outstation
- Mapping Address: Automatically generated according to the address
type.
The following figure is batch adding
measurement points to DNP3 Outstation mapping table:
Introduction to Batch Add Map parameters:
- Register Type: After selection, the matching measurement point
information will be displayed automatically in the table
- Mapping Address: According to the selected address type and the
selected measurement point, the mapping address range of the added measurement
point is automatically displayed.
- Mapping Data Type: The data type of the measurement point in DNP3
Outstation
IEC 61850 Server
IEC 61850 Server Configuration
On the IEC 61850 Server Configuration page,
after enabling IEC 61850 Server, the interface is as shown below:
IEC 61850 Server Configuration interface
parameters:
Basic Settings:
- Port: The port number of the server enabled by the gateway, which
should avoid conflicts with ports enabled by other services
- IED Name: A unique identifier that is named according to the
specific application and requirements. It should generally be descriptive and
clearly express the function or location of the IED. INHAND is used by default.
- LD Name: Logical device names are defined when configuring and
managing IEDs to distinguish between different functional units and identify
them in communication
- Control Mode: Support four kinds of "Direct With Normal
Security", "Sbo With Normal Security", "Direct With
Enhanced Security", "Sbo With Enhanced Secunty".
- Enable password connection: After enabling, fill in the password to
connect to the IEC 61850 Server
- Password: Set the connection password for connecting to IEC 61850
Server
- Mapping Value Setting: support Data original value and Data caculation
value. The default is Data original value (Data original value: the actual
value collected by the southbound device; Data caculation value: the value
after the gateway data caculation)
Data set Settings:
Add dataset interface parameters
Instructions:
- DatasetName: Customize a non-repeatable dataset name
- Enable Report: A mechanism used to periodically send information
about data changes, commonly used to monitor equipment status and parameter
changes in power systems, off by default
- Report Control Name: Defines the parameters and behavior of the
report. A report control block will typically be assigned a unique name that is
used to refer to and identify the report in the configuration.
- Report ID: A value that uniquely identifies the report control
block.
- Configuration revision: Used to identify the specific version of a
configuration file or configuration item
- Buffer: Events that occur in the reporting mechanism are temporarily
stored in a buffer inside the device or system to wait for transmission to the
client
- Integrity period: The period for checking the integrity of the data
in the report. It defines the update frequency of the reported data, that is,
how long the data in the report remains valid and reliable
- Buffer time: The time interval during which the reported data is
buffered before it is sent. When data in a report is updated, the data can be
buffered for a certain amount of time so that other data updates that occur
during that time can be merged into the same report, reducing the number of
reported transmissions and the communication load
- Trigger Options: Trigger conditions for sending report data, support
"Data change", "Quality change ", "Data update",
"Integrity", "General Interrogation" (multiple options)
- Optional Fields: After selecting the parameters, the received report
will contain the configurable optional parameter information. Support
"Sequence number", "Time stamp", "Reason for inclusion",
"Dataset name", "Data reference", "Buffer overflow",
"Entry ID", "Configuration revision" (multiple options)
After configuring the IEC 61850 Server
parameters, click the "Submit" button to enable the IEC 61850 Server
function. In the status page of IEC 61850 Server, you can view the operating
status and connected device information.
Configure the IEC 61850 Server Mapping Table
The following figure is to add measurement
point 1 of the southbound controller to the mapping table of the IEC 61850
Server:
Description of parameters to add the
mapping:
- Controller: Southbound controller device
- Measure: The measuring point in the southbound controller
- Read/Write: The same as the read and write permissions of the
measurement point in the southbound controller (cannot be modified)
- Original Data Type: Same as the data type of the point in the
southbound controller (immutable)
- Data Object Type: Depending on the data type of the selected
measurement point, the options for the data object type are different. (Controllable object types are only supported if the reading and writing permission of the measurement point is Read/Write)
- BIT: Single point state information, controllable single point
- SINT BYTE, WORD, INT, BCD, DWORD, DINT, BCD32, ULONG, LONG: two
point state information, controllable double points, integer status
information, controllable state of integer
- SINT BYTE, WORD, INT, BCD, DWORD, DINT, BCD32, ULONG, LONG, FLOAT,
DOUBLE, measurements, controllable simulation instruction information.
- Mapping Data Type: The data type of the measurement point in IEC
61850 Server
- Mapping Address: Automatically display according to the starting
mapping address.
- Add to dataset:
- Dataset Name:
Enable After adding to a dataset, select from the drop-down box. The content of
the drop-down box is the configured data set when IEC 61850 Server is
configured.
The following figure is the configuration
interface for batch adding measurement points to the IEC 61850 Server mapping
table (Note: "dataset name" is optional)
:
Introduction to Batch Add Map parameters:
- Data Object Type: According to the data object type table, the
supported southbound measurement points are displayed. Correspondence (Note:
controllable measuring points only show Read and Write permissions as:
Read/Write) :
- SPS,SPC: BIT data type;
- DPS,DPC,INS,INC: SINT, BYTE, WORD, INT, BCD, DWORD, DINT, BCD32,
ULONG, LONG data types;
- DPS,DPC,INS,INC,MV,APC: BYTE, SINT, WORD, INT, BCD, DWORD, DINT,
BCD32, ULONG, LONG, FLOAT, DOUBLE data type.
- Mapping Data Type: The data type of the measurement point in IEC
61850 Server
SNMP Agent
SNMP Agent configuration
On the Configuration page of the SNMP
Agent, after enabling the SNMP Agent, the interface is as shown below:
SNMP Agent configuration interface
parameters description:
- Port: The port number of SNMP, the default is 161
- Version: Three major versions are supported, namely V1, V2C, V3. The
default is the V3 version used
- If the protocol version used is V3:
- User Name: The SNMPv3 secure name used to authenticate during
communication.
- Enable Auth: Once enabled:
- Authentication Method: MD5 and SHA are supported
- Authentication password: Authentication mechanism, under authNoPriv
and authPriv level, the authentication password needs to be provided to verify
the identity of the sender of the message.
- Enable Encipher: When configuring SNMPv3 users, you need to ensure
that the encryption option is enabled for each user and provide the
corresponding encrypted password.
- Encryption Method: supports DES, AES128
- Encryption Password: Encrypts the content of the message.
- Community: This is similar to a password and is used to identify the
user or management system that is allowed to access the SNMP agent
- Read/Write: Configure Read and write permissions of measuring points
in the mapping table, support Read, Read/Write.
- Enable Trap: If enabled, SNMP Agent will detect whether the data of the
mapping point has changed, and report Trap message if it has changed.
When enabled:
- Trap Ip: The destination address IP of the reported Trap message
- Trap Port: The port of the destination address of the reported Trap
message, default is 162
- Version: Three major versions are supported, namely V1, V2C, V3. The
default is the V3 version used
- If the protocol
version used is V3:
- Engine ID: The engine ID is used to generate and verify the security
parameters of the message, such as authentication password and encryption
password. Usually a hexadecimal string of variable length
- User Name: The SNMPv3 secure name used to authenticate during
communication.
- Enable Auth:
- Authentication enabled or not: Once enabled:
- Auth Method: MD5
and SHA are supported
- Auth Password:
Authentication mechanism, under authNoPriv and authPriv level, the
authentication password needs to be provided to verify the identity of the
sender of the message.
- Whether encryption is enabled or not: When configuring SNMPv3 users,
you need to ensure that the encryption option is enabled for each user and
provide the corresponding encrypted password.
- Auth Method:
supports DES, AES128
- Auth Password: Encrypts the content of the message.
- Community: This is similar to a password and is used to identify the
user or management system that is allowed to access the SNMP agent
- Mapping value setting: supports Data original value and Data caculation
value. The default is Data original value (Data original value: the actual
value collected by the southbound device; Data caculation value: the value
after the gateway data caculation)
After configuring the SNMP Agent
parameters, click the "Submit" button to enable the SNMP Agent
function. In the status page of SNMP Agent, you can view the running status
information.
Configure the SNMP Agent Mapping Table
The following image is to add the
measurement point 1 of the southbound controller to the SNMP Agent:
Description of the parameters to add the mapping:
- Controller: Southbound controller device
- Measure: The measuring point in the southbound controller
- Read/Write: Same as the read and write permissions of the point in
the southbound controller (immutable)
- Original Data Type: Same as the data type of the point in the
southbound controller (immutable)
- Mapping Data Type: The data type of the measurement point in SNMP
Agnet
- OID: The node address used to uniquely identify the management
information. An OID is an identifier consisting of a series of numbers used to
represent various objects in the network, such as devices, interfaces,
parameters, etc. Each managed object is identified by a unique OID. The
structure of an OID is a series of numbers separated by dots. In DSA OID is
generated automatically
Shown below is to choose the point after 2, 4, generate the OID node
address, measuring point correspondence address is 2, point 4 correspondence
address is 3 (batch add OID node address mapping
interface omitted ". 1.3.6.1.4.1.36153.1.2.0. ")
Introduction to Batch Add Map parameters:
- OID: After checking the measurement point that you want to add in
bulk, press the checked measurement point from front to back to generate the
node address range in turn.
- Mapping Data Type: The data type of the measuring point in the
SNMP Agent
Appendix: Cloud services
Instructions for using standard MQTT cloud services
1. EMQX Client
configuration
The
EMQX's official website (https://www.emqx.com/zh/mqtt/public-mqtt5-broker),
select online using MQTT client tool for testing
Click on "New Connection" in the
pop-up window that opens, after filling in the Name field in the interface that
pops up afterwards, the rest of the configuration does not need to be modified,
and finally click on "Connect".
2. Edge
Computing Gateway configuration
2.1 Connect to EMQX's free server
The data collection configuration for
standard MQTT cloud services is shown in the diagram (for configuring the
Modbus controller and instructions, please refer to the Quick Start):
2.2 Connect to EMQX's free server
On the “MQTT Cloud Service” page, after
enabling cloud services, select "MQTT" in the "Cloud Types" section and fill in the
corresponding parameters.Here's the configuration information for our example:
- Server address: broker.emqx.io
- Client ID: Any ID that is unique to the server
Leave the rest as default
Click the "Submit" button when
the configuration is complete, as shown below:
The description of each parameter is as
follows:
Basic Settings:
- Server Address: The server
address used to establish the MQTT network connection
- Client ID: Any ID that is
unique to the server
- Enable Authority: Once enabled,
you can set the MQTT username and password
- MQTT username: The Username
needed to connect to the MQTT server after the server has enabled the
authentication mechanism for username passwords
- MQTT password: The Password to
be used to connect to the MQTT server after the server has enabled the
authentication mechanism for username and password
Advanced Settings:
- Port: The port of the MQTT
server address
- Keep Alive: The time interval
at which the client sends heartbeats
- TLS encryption:
- Disable: Turns off TLS
encryption
- Symmetric Encryption (client
and server share one account and key) :
- Identity: The account
number saved on the server and used to verify identity
- Pre-shared Key: The key associated with the account
stored on the server that is used to encrypt the request or the digest of the
request
- Asymmetric Encryption (client
generates a unique key pair, and client and server share the public key) :
- Verification Method: Two types
are supported: Verify client CA and Verify client cer and key
- Verify Server Cert: When
enabled, the server certificate will be verified for validity
- Verify client CA: This uses a
certificate issued by a third-party trusted certificate authority that is
preinstalled with the gateway
- Verify client cer and key: It
uses a certificate issued by a certificate authority it creates
- rootCA: The CA root
certificate
- Client Private Key: The
certificate file used for data encryption and decryption
- Client Cert: The
certificate file used for client authentication
- Clear Session: It clears the
session and reestablishes the session when the connection is disconnected and
reconnected
- MQTT Version: The version of
MQTT used by the connection when establishing MQTT
Last-Will and Testament:
- Topic: Will message topic
- Qos: Will message level
- Retain: When enabled, the
broker keeps the latest messages and sends them to the subscriber as soon as a
new MQTT client subscribes to the corresponding topic
- Payload: The published
testament message
2.3 Publish the message to the MQTT server
Publish and subscribe messages in Message
Management configuration after submission. Here's how to configure a publish
message with the name inhand_pub and the Topic pubdata:
The publish message configuration
parameters are described as follows:
- Name: user-defined release name (Note: this name is unique in the
message management of all cloud services and the release message name in the
custom fast function)
- Trigger Source Type: The type of the release message, supporting
"Measuring Point Group" and "Alarm Message".
- Group/Label: Select according to the " Trigger Source Type
", if it is " Measuring Point Group ", select the group of the
measuring point, if it is " Alarm Message ", select the label of the
alarm.
- Hide Offline Data: When enabled, off-line measurement points will be
blocked and no longer published
- Topic: A custom Topic
- Qos(MQTT): Publishes Qos, which is recommended to be consistent with
the Qos of the MQTT server
- Entry Function: Keep the same name as the entry function in the
script
- Quickfuction: Customize the group package and release logic using
Python code. (Just use the default code provided)
Subscribe to messages in the EMQX online
client
After the connection is successful, select
the message type as JSON, click "New Subscription", in the pop-up
window, Topic and Qos fill in the Topic and Qos of the message published by the
gateway, and finally click "Confirm". Finally, you can view the data
reported by the gateway
2.4 Subscribe to MQTT messages
Here's a subscribe message configured with
the name inhand_sub,Topic subdata, and JSON Payload:
The subscribe message configuration
parameters are explained as follows:
- Name: Custom subscription name (Note: this
name is unique in the message management of all cloud services and the name of
subscription messages in custom fast functions)
- Topic: The same as the publisher's Topic
- Qos (MQTT) : Subscribe to Qos, which is
recommended to be consistent with the Qos of the MQTT server
- EntryFunction: Keep the same name as the
entry function in the script
- Payload Type: Plaintext, Base64, JSON, HEX
supported
- QuickFunction: Use Python code to customize
the unpacking and subscription logic. When adding a subscription message, there
is a default subscription script, and the default script can subscribe to the
message. You can modify this script according to your needs.
Publish a message in the EMQX online
client
Using the publish function of the online
tool, fill out the publish message and choose JSON for the message type. The
Topic, Qos and the Topic, Qos subscribed by the gateway are kept the same, and
finally click the "Publish" button, that is, the published message
can be viewed in the gateway log
Instructions for using MQTT SparkPlugB
1. Ignition
Configuration
Use Ignition software to view the data
uploaded by the gateway and the data delivered to the gateway. You can download
the Ignition software Download
Ignition by Inductive Automation
After installation, do the following
In the window that appears, select
"Standard Edition." Set a username password and finally click on
"Start Gateway"
Set the Ignition login username password
Download "Designer Launcher" and
add Designer after installation
Click
here to download the
MQTT-Engine-signed.modl module.
Import the MQTT-Engine-signed.modl module
you just downloaded from Config > Modules
After adding, an MQTT ENGINE configuration
item will appear in the Config interface menu bar. Click to enter the
Configuration
Uncheck these two functions. Fill in the
address of the server, the EMQX server, for example, URL: TCP: / / broker.
EMQX. IO: 1883. Finally click "Save Changes"
Once the configuration is complete, open
the Designer Launcher software and double-click on the Designer you just added.
Fill in Ignition's username and password.
Create a Project, just add a Project Name
and finally click "Create New Project"
2. Edge
Computing Gateway configuration
2.1 Data Collection Configuration
The data collection configuration for
Standard MQTT Cloud Services is illustrated in the diagram (for Modbus
controller setup and instructions, please refer to the Quick Start):
2.2 Connect to the MQTT server
On the MQTT Cloud Services page, after
enabling cloud services, select "MQTT SparkPlugB" in the "Cloud
Types" section and fill in the corresponding parameters.
This example uses the EMQX server as a case
study. The sample configuration is as follows:
- Server Address: broker.emqx.io
- Client ID: Any unique ID for the server
- GroupID: The group to which the current gateway belongs. (Note: The
gateway's SN is the Node ID)
The rest of the settings can be left as
default.
After
submitting the configuration, the gateway will automatically generate scripts
for publishing and subscribing.
The parameters are explained as follows:
Basic Settings:
- Server Address: The server address used to establish the MQTT
network connection
- Client ID: Any ID that is unique to the server
- GroupID: The group to which the current gateway belongs. (Note: The
gateway's SN is the Node ID)
- Enable Authority: Once enabled, you can set the MQTT username and
password
- MQTT username: The Username needed to connect to the MQTT server
after the server has enabled the authentication mechanism for username
passwords
- MQTT password: The Password to be used to connect to the MQTT server
after the server has enabled the authentication mechanism for username and
password
Advanced Settings:
- Port: The port of the MQTT server address
- Keep Alive: The time interval at which the client sends heartbeats
- TLS encryption:
- Disable: Turns off TLS encryption
- Symmetric Encryption (client and server share one account and key) :
- Identity: The account number saved on the server and used to verify
identity
- Pre-shared Key: The key
associated with the account stored on the server that is used to encrypt the
request or the digest of the request
- Asymmetric Encryption (client generates a unique key pair, and
client and server share the public key) :
- Verification Method: Two types are supported: Verify client CA and Verify
client cer and key
- Verify Server Cert: When enabled, the server certificate will be
verified for validity
- Verify client CA: This uses a certificate issued by a third-party
trusted certificate authority that is preinstalled with the gateway
- rootCA: The CA root certificate
- Client Private Key: The certificate file used for data encryption
and decryption
- Client Cert: The certificate file used for client authentication
- Verify client cer and key: It uses a certificate issued by a certificate authority it creates
- Clear Session: It clears the session and reestablishes the session
when the connection is disconnected and reconnected
- MQTT Version: The version of MQTT used by the connection when
establishing MQTT
2.3 Publish messages to the MQTT server
View the data published by the gateway via
Ignition. (Note: The software cannot parse some data types because the values
of the gateway and this software defined data type are different)
2.4 Subscribe to MQTT messages
Double-click the value of the point you
want to modify in Ignition, and then type Enter. In the subsequent pop-up
window, click "Write Once". Finally, you can see the modified value
in the point monitor on the gateway.
Alibaba Cloud IoT User introduction
1. Alibaba
Cloud Configuration
If you have already configured the
corresponding products and devices in Alibaba Cloud's iot cloud platform, you
can directly check the next section 4.1.3.2 Edge Computing Gateway
Configuration. Otherwise,
please follow the following process to configure the products and devices in
the iot cloud platform. Visit Alibaba Cloud official website https://www.aliyun.com
and log in. After logging in, select "Iot Platform".
Click "Activited" after entering
the Iot Platform
1.1 Creating Product
Step 1: Create the product
Enter the
following page and click "Create Product".
Here is an example of adding a street
lighting product. Note: The data format only supports "ICA Standard Data
Format", and the authentication method only supports "Device Secret".
Step 2: Define features for the product
(optional)
Once created, click "Go to Function Definition"
Click "Edit Draft" to configure
the feature definition for your product.
Click "Add Self-defined Feature"
and configure the corresponding "services" and "events,"
see Add Single TSL Model for an introduction to services and events. Note: When configuring the service, the invocation mode only
supports asynchronous.
Configuring the service (not required when
using Custom Topic)
Click "Add Parameter" under
"Input Parameter" and configure the appropriate input parameters.
Configure the “Events” (you don't need to
configure this when using custom Topic)
Under "Output Parameter" click
"Add Parameter" and configure the appropriate output parameters.
Click "Release Online" when the
configuration is complete to submit the configuration.
Step 3: Export the Object Model TSL
After the product configuration is
completed, click "TSL Model" on the "Define Feature" page,
then select "Full TSL" and click "Export TSL File" for
subsequent use. Note: Do not select "reduced
object model" when exporting object model, otherwise it may lead to
abnormal data reporting.
1.2 Creating the device
Go to Devices > Devices > Device List
and click Add Device.
Select the product created in the previous
step and configure the other parameters.
Click "Learn more" to view the
details of the device after adding successfully.
The "Device Information" page
looks like this:
At this point, the corresponding products
and devices have been configured in the iot cloud platform of Alibaba Cloud.
2. Edge
computing gateway configuration
2.1 Data Collection Configuration
The data collection configuration for
Standard MQTT Cloud Services is illustrated in the diagram (for Modbus controller
setup and instructions, please refer to the Quick Start):
2.2 Connect to Alibaba Cloud
On the MQTT Cloud Service page, check
"Enable Cloud " and select the type as "Alibaba Cloud"
Alibaba Cloud IoT has two authentication methods: Unique-certificate-per-device
Authentication and Unique-certificate-per-product. For detailed information
about authentication methods, please refer to Alibaba Cloud device security certification
When
connecting to Alibaba Cloud IoT using the " Unique-certificate-per-device
Authentication " authentication method, choose the authentication method
as " Unique-certificate-per-device Authentication." The example
configuration is as follows:
The parameters are described as follows:
- Region ID: For the configuration of the Region ID, refer to the Region and zone document where the region name is East China 2, thus use cn-shanghai.
- Authentication Method: Choose the authentication method according to
the actual situation, and use one machine and one secret this time
- ProductKey: Go to the "Devices > Devices >IoTTest"
page, click "View" after "DeviceSecret" to copy the
authentication information.
- DeviceName: Get the ProductKey of the same machine.
- DeviceSecret: Gets the ProductKey of the same machine secret of the
method.
- TSL Model: Import the Thing Model file saved when importing Create product. Note: In "Message
Management," if only "Custom Topic" type messages are used,
importing the TSL Model is not necessary.
The following figure shows the successful connection to
Alibaba cloud IoT:
When using the authentication method of
"Unique-certificate-per-product" to establish a connection with
Alibaba Cloud IoT, choose the authentication method of
"Unique-certificate-per-product". The example configuration is as
follows:
Note:
When the authentication
method is " Unique-certificate-per-product ", "Dynamic
Registration" needs to be enabled.
Only non-activated
devices support the establishment of connection with Alibab Cloud IoT through
the mode of Unique-certificate-per-product and the device is automatically
activated after the connection is established. After activation, the device
switches to Unique-certificate-per-device Authentication connection with Ali
Cloud IoT. You can check whether the device has an activation time on the
device page to determine whether the device has been activated.
The parameters are explained as follows:
- Region ID: Same as Unique-certificate-per-device Authentication
- Auth Method: Choose the authentication method according to the
actual situation, and use Unique-certificate-per-product this time
- ProductKey: Go to the page of "Devices > Devices > Aliyun
IoT" and click "View" after "ProductSecret" to copy
the authentication information.
- DeviceName: The name of the device, to
obtain the ProductKey of the same machine.
- ProductSecret: Gets the ProductKey of the
same type of method.
- TSL Model: Import the
Thing Model file saved during the import of Create a product. Note: It is not necessary to import
the Thing Model when only using "Custom Topic" type messages in
"Message Management."
The following figure shows the successful
connection to Alibaba Cloud IoT:
2.3 Publish the message to Aliyun IoT
Add publish on the MQTT Cloud Service page.
There are three types of Add publish supported: Custom Topic, Properties, and Events.
For the data format requirements during
data reporting, refer to the TSL model development
Note: When using Attribute
reporting and Event reporting, please ensure that the "TSL Model TSL"
matches the thing model of the product in Alibaba Cloud IoT.
2.3.1 Custom Topic
An example configuration for Posting a
message with a Custom Topic type is as follows:
The Posting message configuration
parameters are described as follows:
- Name: user-defined release name (Note: this name is unique in the
message management of all cloud services and the release message name in the
custom fast function)
- Trigger Source Type: The type of the release message, supporting
"Measuring Point Group" and "Alarm Message".
- Group/Label: Select according to the "Trigger Source
Type", if it is Measuring Point Group", select the group of the
measurement point, if it is "Alarm Message", select the label of the
alarm.
- Hide Offline Data: When enabled, off-line measurement points will be
blocked and no longer published
- Type: Support "Custom Topic", "Properties",
"Events".
- Topic: Publish Topic, which is consistent with the Topic class whose
"Operation Authorization" is "Publish" in "Devices
> Products > AliyunIoT > Topic Categories > Topic Category"
page of Aliyun IoT. Note: The ProductKey and DeviceName
information in the theme will be completed automatically. Just copy the topic
information after ${deviceName}/ when configurating the theme.
- Qos(MQTT) : Published Qos, recommended to be consistent with the Qos
of the MQTT server.
- Entry Function: Keep the same name as the entry function in the
script
- QuikFunction: Use Python code to customize the group package and
publishing logic. When adding publishing messages, there is a default
publishing script, and the default script can publish messages. You can modify
this script according to your needs.
2.3.2Properties
You can go to "Devices> Product
> Aliyun IoT > Define Feature" page to view the product attribute
events and other information. The example product has an attribute named
"Working Status" with the identifier of "LightStatus".
Using the example script, the value of the "LightStatus" variable can
be uploaded to Alibaba Cloud IoT through the attribute report, and the
configuration is as follows.
Please refer to Custom topic for the
description of the configuration parameters of the release message.
Use the default Topic.
Example function code:
# Enter your python code.
import json
import random
from common.Logger import logger
from quickfaas.aliyuniot import thing_post_property
def main(message):
logger.debug(message)
for
measure in message['measures']:
if
measure['name'] == 'LightStatus':
thing_post_property(__topic__, {"LightStatus":
measure['value']})
The attribute status can be viewed in
"Devices> Devices > IoTTest > TSL Data > Status" page of
Alibaba Cloud IoT.
Events
You can go to the "Device Management
> Product > Ali Cloud IoT > Function Feature" page to view the
product's attribute events and other information. The sample product has an
event named "Event test" with an identifier of
"event_test". Using the example script, the value of
"event_test" variable can be uploaded to Alibaba Cloud IoT through
event reporting, as configured below.
See Custom topic for a description of the
configuration parameters for publishing messages.
Use the default Topic.
Example function code:
# Enter your python code.
import json
import random
from common.Logger import logger
from quickfaas.aliyuniot import thing_trigger_event
def main(message):
logger.debug(message)
if
message['measureName'] == 'event_test':
thing_trigger_event(__topic__, ("event_test",
{"ErrorCode": message['value']}))
When triggering an
event report, you need to configure an alarm rule for the
"event_test" measurement point. The alarm information is as follows
(for configuring alarm rules, please refer to: 2.2 Alarm Rules):
After configuring the alarm rule, modifying
the measurement point's value to be greater than 15 will trigger an event
message report. You can view the property status on the "Devices >
Devices > IoTTest > TSL Data > Events" page in Alibaba Cloud IoT.
2.4 Subscribe to Aliyun IoT's messages
On the MQTT Cloud Services page, add
subscription messages under "Message Management > Subscribe".
Subscription messages support four types of messages: Custom Topic, Service Call,
Property Setting and RRPC.
2.4.1 Custom topic
An example configuration with a custom
topic message type is as follows:
The subscribe message configuration
parameters are explained as follows:
- Name: Custom subscription name (Note: this name is unique in the
message management of all cloud services and the name of subscription messages
in custom fast functions)
- Type: Support 4 types, namely: Custom Topic, Service Call, Property Setting,
RRPC.
- Topic: Subscribe Topic, which is consistent with the Topic class
whose "operation permission" is "Subscribe" in "Devices
> Products > Ali Cloud IoT > Topic Categories > Topic Category"
page of Ali Cloud IoT. Note: The ProductKey and
DeviceName information in the topic will be completed automatically. Just copy
the topic information after ${deviceName}/ when configurating the topic.
- Qos: Subscribe to Qos, default is 1.
- Entry Function: Keep the same name as the entry function in the
script
- Payload types: Plaintext, Base64, JSON, HEX supported
- QuickFunction: Use Python code to customize the unpacking and
subscription logic. When adding a subscription message, there is a default
subscription script, and the default script can subscribe to the message. You
can modify this script according to your needs.
2.4.2 Service Call
The following is an example of a service
call that can accept the "Service test" setup instruction issued by
Aliyun IoT. Note: When using the service test, make sure that the "TSL Model"
in the gateway is consistent with the thing model of the product in Aliyun IoT.
For the
explanation of Service Call parameters, please refer to Custom Topic. (Note:
Unlike Custom Topic, you need to modify the default Topic. The service
identifier can be obtained under "Devices > Product> Aliyun IoT >Define
Feature ").
Example function code:
# Enter your python code.
import json
import random
from common.Logger import logger
from quickfaas.aliyuniot import thing_answer_service
def main(topic, payload):
logger.info(topic)
topic =
topic + "_reply"
thing_answer_service(topic, {"Power": random.randint(0, 10)})
Enter the "Maintenance > Online
debug > Debugging real equipment > service calls" page of Alibaba
Cloud IoT to select the corresponding products and equipment for service call
test; Check the service call information in the "Devices > Devices >
IoTTset> TSL Model> Invoke Service" page.
2.4.3 Property Settings
The following is an example of property
setting, which can accept the "Working status" instruction issued by
Ali Cloud IoT. Note: When using the property Settings, make sure that the
"TSL Model" in the gateway is consistent with the TSL Model of the
product in Aliyun IoT.
Please refer to Custom topic for
instructions on subscribe message configuration parameters.
Example function code:
# Enter your python code.
import json
from common.Logger import logger
from quickfaas.measure import write_plc_values
def write_callback(message, userdata):
logger.debug("write plc response: %s, userdata:%s" % (message,
userdata))
def main(topic, payload, cloudName):
logger.debug("subscribe topic: %s, payload: %s, cloudName: %s"
% (topic, payload, cloudName))
write_plc_values(message={"LightStatus":json.loads(payload)['params']['LightStatus']},
callback=write_callback, userdata="")
Enter the "Maintenance > Online
Debug > Debugging real equipment > Property Debugging" page of Ali
Cloud IoT to select the corresponding products, devices, debugging functions
and methods for attribute setting testing; Check the running status of the
equipment in the "Devices > Devices> IoTTest >TSL Model > Status"
page.
2.4.4 RRPC
See Custom topic for instructions on
subscribe message configuration parameters. (Note:
Please select Base64 for Payload type)
Example code function:
# Enter your python code.
import json
import base64
from common.Logger import logger
from quickfaas.aliyuniot import thing_answer_rrpc
def main(topic, payload):
logger.debug(topic)
logger.debug(base64.b64decode(payload))
topic =
topic.replace("request", "response")
thing_answer_rrpc(topic, payload)
After configuring the gateway, click the link here to enter the
interface of calling RRPC service.
When the value of "success" in
the result information is true, the delivery is considered successful
"RequestBase64Byte" means you
want to send a Base64-encoded message. For example, the Base64-encoded value
for {" Power ":1} is eyJQb3dlciI6IDF9.
Finally, you will be able to view the sent
message in the gateway log
AWS IoT Instructions
1. AWS IoT
Configuration
If you've already configured the things,
policies, and certificates in the AWS IoT console, you can go straight to the
next section 4.1.4.2 Edge Computing Gateway Configuration. Otherwise,
follow the process below to configure the IoT console. Visit the AWS official
website https://aws.amazon.com/
and log in to the console. Users in China region can use AWS services in AWS
China region at https://cn-northwest-1.console.amazonaws.cn.
It should be noted that the data of the two are
independent of each other. Select "IoT Core" after logging
into the console, or "AWS IoT" when using AWS services in China. Once
logged in, search for "Amazon IoT" and once inside create an item and
attach policies and download certificates.
2. Edge
Computing Gateway configuration
2.1 Data Collection Configuration
The data collection configuration for the
Standard MQTT Cloud Service is illustrated in the diagram (for Modbus
controller setup and instructions, please refer to the Quick Start):
2.2 Connect to AWS IoT
On the
MQTT Cloud Services page, check "Enable Cloud" and select the type as
"AWS IoT." An example configuration is as follows:
The parameters are described as follows:
- Endpoint: The address of the AWS IoT end node, which can be obtained
from the "Settings" page of AWS IoT. Remove
the "-ats" from the address when using "VeriSign Class 3 Public
Primary G5 Root CA Certificate"
- Client ID: Any unique ID
- Certificate For Thing: Import the item certificate downloaded when
creating the item or a custom certificate
- Private key: Import the private key downloaded when creating the
item or a custom private key
- rootCA: Import the CA certificate used for server authentication,
you can either import the CA1 certificate downloaded when creating the item, or
download the corresponding CA certificate from here (Amazon Root CA1 or Starfield Root CA certificate is
recommended). "Amazon Root CA 3" certificates
are not currently supported
- Port: 8883
Use the default configuration for the rest
2.3 Publish messages to AWS IoT
Add a publish message in MQTT Cloud Service
> Message Management with the following configuration:
Example function code:
# Enter your python code.
import json
from common.Logger import logger
from quickfaas.awsiot import awsiot_publish
def main(message):
logger.debug(message)
awsiot_publish(__topic__, json.dumps(message), __qos__)
The publish message configuration
parameters are described as follows:
- Name: user-defined release name (Note: this name is unique in the
message management of all cloud services and the release message name in the
custom fast function)
- Trigger Source Type: The type of the published message, supporting
"Measuring Point Group" and "Alarm Message".
- Group/Label: Select according to the " Trigger Source Type ",
if it is " Measuring Point Group ", select the group of the
measurement point, if it is " Alarm Message ", select the label of
the alarm.
- Hide Offline Data: When enabled, off-line measurement points will be
blocked and no longer published
- Topic: Custom Topic
- Qos(MQTT) : QoS is released
- Entry Function: Keep the same name as the entry function in the
script
- QuikFunction: Customize the group package and release logic using
Python code.
Subscribe to messages in AWS IoT
Go to the "test /MQTT test client"
page of AWS IoT and enter the publishing Topic of the gateway in "Subscribe
to a topic", this document is awsiot/test.
After subscribing to the message, after subscribing
to the topic, you can view the content of the received message in the Subscribe
topic page.
2.4 Subscribe to AWS IoT messages
Add a subscribe message in MQTT Cloud
Services > Message Management with the following configuration:
- Name: Custom subscription name (Note: this
name is unique in all cloud services' message management and subscription
messages in custom fast functions)
- Topic: The subscription topic, which is
consistent with the topics published by AWS
- Qos(MQTT) : Subscribe to Qos, defaults to
1.
- Entry Function: Keep the same name as the
entry function in the script
- Payload Type: Plaintext, Base64, JSON, HEX
supported
- QuickFunction: Use Python code to customize
the unpacking and subscription logic. When adding a subscription message, there
is a default subscription script, which can subscribe to the message. You can
modify this script according to your needs.
Configure the Topic and Payload of the
published message in AWS. After clicking Publish, the published message will be
viewed in the gateway's log
Instructions for Azure IoT
1. Azure IoT
Configuration
If you have already configured the
corresponding IoT Hub and IoT device in Azure IoT, you can directly check the
next section Edge Computing Gateway configuration. Otherwise, follow the
process below to configure Azure IoT. Log in to Azure by visiting https://portal.azure.cn/.
1.1 Creating the device
Once logged in to Azure, select "IoT Hub"
Click "Create" to create an IoT
Hub.
Click "Create new" to create a
resource group, or use an existing resource group.
After successful creation, create a device.
It looks like this:
The following screenshot shows the
successful creation:
2. Edge
Computing Gateway configuration
2.1 Data Collection Configuration
The data collection configuration for the
Standard MQTT Cloud Service is illustrated in the diagram (for Modbus
controller setup and instructions, please refer to the Quick Start):
2.2 Connect Azure IoT
On the
MQTT Cloud Service page, select Enable Cloud Service and set Type to Azure IoT.
The following is an example configuration:
The parameters are described as follows:
- Auth Method: There are three authentication
methods (Symmetric Key; X.509 Self-Signed; X.509 CA Signed), chosen based on
the type of authentication the device was created with.
- Connection String: The primary connection
string of the Azure IoT Device, you can select the appropriate device from
Azure IoT's IoT Hub and copy the primary connection string to here
2.3 Publish messages to Azure IoT
Add a publish message in MQTT Cloud
Services > Message Management with the following configuration:
The release message configuration
parameters are explained as follows:
- Name: user-defined release name (Note: this name is unique in the
message management of all cloud services and the release message name in the
custom fast function)
- Trigger Source Type: The type of the release message, supporting
"Measuring Point Group" and "Alarm Message".
- Group/Label: Select according to the " Trigger Source Type ",
if it is " Measuring Point Group ", select the group of the
measurement point, if it is " Alarm Message ", select the label of
the alarm.
- Hide Offline Data: When enabled, off-line measurement points will be
blocked and no longer published
- Topic: A custom Topic
- Qos(MQTT) :Qos is released
- Entry Function: Keep the same name as the entry function in the
script
- QuickFunction: Customize the group package and release logic using
Python code. (Just use the default code provided)
Use VS Code's Azure IoT Tools plugin to
establish a connection to IoT Hub
Once you've posted your message after
submitting, use the Azure IoT Tools plugin of Visual Studio Code software
(hereinafter referred to as VS Code) to view the messages sent to Azure IoT.
You can visit: https://code.visualstudio.com/Download for the corresponding
Visual Studio Code software (hereinafter referred to as the v Code). Once VS
Code is installed, open VS Code and click on "Extensions", enter
Azure IoT Tools in the search box and install the Azure IoT Tools plugin.
You can see the Azure module on the left
after the installation.
Click on "Explorer > AZURE IOT
HUB" to expand AZURE IOT HUB. Click on "... > Set IoT Hub
Connection String "Set the IoT Hub connection string. Enter the IoT Hub
connection string in the prompt box. The connection string for the IoT Hub is
available from the "Policy Name > iothubowner" page for the
specified IoT hub.
Enter the connection string and press Enter
under "AZURE IOT HUB" to see the created Azure IoT Device and the
connection status.
Right click on the specified Azure IoT
Device and select Start Monitoring Built-in Event Endpoint from the menu to see
the data pushed by the gateway to the IoT Hub.
Fill in the string shown below in the
pop-up window to view the reported data
2.4 Subscribe to Azure IoT messages
Add a subscribe message in MQTT Cloud
Services > Message Management with the following configuration:
- Name: Custom subscription name (Note: this
name is unique in all cloud services' message management and subscription
messages in custom fast functions)
- Topic: The subscription topic, which is
consistent with the topics published by AWS
- Entry Function: Keep the same name as the
entry function in the script
- Payload Type: Plaintext, Base64, JSON, HEX
supported
- QuickFunction: Customize unpacking and
subscription logic using Python code. This script can be modified according to
your needs.
Example function code:
# Enter your python code.
import json
from common.Logger import logger
def main(topic, payload)
logger.debug(topic)
logger.debug(json.loads(payload))
Right click on the specified Azure IoT
Device and select Send C2D Message to Device from the menu to send the data to
the gateway.
Enter the data you want to send in the send
box, such as {" message ":" hello "}
After hitting Enter to send the data, you
can see a log of the successful delivery of the message in the Output window
At the same time, you can also view the
sent message in the log of the gateway side
Appendix: Exported configuration files
Measuring Point CSV File Parameter Description
- MeasuringPointName: measuringPointName
- ControllerName: The name of the controller
to which it belongs
- GroupName: Group to which it belongs
- UploadType: Upload mode; supports periodic,
onchange, and never
- DeadZonePercent: Change dead zone
- DataType: The type of data
- ArrayIndex: The array index. This parameter
should be configured for the OPC UA protocol or OPC UA PUBSUB protocol
- EnableBit: This is a bitwise value
- BitIndex: Bits
- reverseBit: Take
the inverse
- -Sheldon: The Address.
- Decimal: The number of decimal places, only
configured when the data type is a FLOAT or DOUBLE
- Len: Length, only configured for STRING
data type
- CodeType: The character encoding format,
only configured for STRING data type
- ReadWrite: Read and write permission
- Unit: Unit
- -Sheldon: The Description.
- Transform Type: data operation, none, gain,
zoom, ptct, PT/CT, bit, numMapping, numeric mapping.
- MaxValue: upper limit of data
- MinValue: Lower bound on the data
- MaxScale: Upper limit of proportion
- MinScale: Lower limit of scale
- Gain: Multiplier
- Offset: The offset
- startBit: The starting bit
- endBit: The end bit
- Pt: Pt
- Ct: Ct
- Mapping_table: Map table for numeric
mappings, for example to configure original value as 1, map value as 2, the
content of this entry is [{'source': 1, 'target': 2}]
- TransDecimal:
- bitMap: Enables numeric mapping to 1 when the
data type is BIT, or after using bit interception, and 0 otherwise
- msecSample: When the controller enables
packet reporting, the measurement point is configured to be 1 when packet
reporting is enabled, and 0 otherwise
- storageLwTSDB: Stores historical data
- DataEndianReverse: The test point byte
order of the test point of the simple drive protocol, which is 0 when
consistent with the controller and 1 when opposite to the controller
- ReadOffset: Start reading bytes
- ReadLength: Reads the length in bytes
- WriteOffset: Start writing bytes
- WriteLength: The length in bytes to write
- DataParseMethod: The resolution method of
the measure point for the simple drive protocol
- BitId: Obsolete
- pollCycle: Polling cycle. 0 is polling
cycle, 1 is polling cycle 2
- GroupName: Group name
- UploadInterval: Reporting period
- EnablePerOnchange: Periodically report
Onchange data
- OnchangePeriod: Onchange reporting period
- LwTSDBSize: Maximum number of entries. Range
1-150000
- strategy: Store the strategy. 1:
Synchronize with the reporting cycle; 2: independent storage cycle
- storagePeriod: Storage period in seconds.
Range 1-86400
- historyDataMode: Storage method. gateway:
Gateway storage; usb: USB; sd: SD card
- historyDataPath: Storage path
Alarm Rules CSV file parameter description
- AlarmName: Alarm name
- ControllerName: Controller name
- MeasuringPointName: MeasuringPointName
- AlarmLevel: Alarm level
- Condition1: Judge condition 1.
"=", "! = ", ">", "p",
"<", "" or less is the corresponding" eq ",
"neq", "gt" and "egt", "lt" and
"elt.
- Operand1: Determines the numerical value of
condition 1, which can only be an integer or decimal number
- CombineMethod: Determines the condition.
None: no logical condition; and: && logical condition; Or: | | logical
condition
- Condition2: judge condition 2.
"=", "! = ", ">", "p",
"<", "" or less is the corresponding" eq ",
"neq", "gt" and "egt", "lt" and
"elt.
- Operand2: Determines the numerical value of
condition 2, which can only be an integer or decimal number
- AlarmContent: The alarm content, which
cannot be longer than 70 characters
- AlarmTag: Alarm tag
- AlarmLableName: Alarm label name, ranging
from 1-240 bytes
- MeasuringPointName: The name of the
measuring point
- ControllerName: The name of the controller
- GroupName: Group name
- UploadName: The name of the upper cloud
measurement point
- Hide: Shield. 0 is for not masking the
measurement point; 1 is a shielded measurement point
- Measuring Point Name: Measuring point name
- Controller Name: The name of the controller
to which the measuring point belongs
- readWrite: read and write permission, the
value is the same as the read and write permission of the measure point in the
controller.
- Data Type: The original data type, which is
consistent with the data type of that measure point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This matches the bitwise value
of the point in the controller, which is 1 if the point is enabled, 0 if it is
not enabled, or null if it is not configured. For example, EnableBit is null if
the point's raw data type is FLOAT.
- Start Mapping Address: The start address in
the registers of Modbus TCP Slave.
IEC 104 Server
- Measuring Point Name: The name of the
measuring point
- Controller Name: The name of the controller
to which the measuring point belongs
- Data Type: The original data type that
matches the data type of the point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This matches the bitwise value
of the point in the controller, which is 1 if the point is enabled, 0 if it is
not enabled, or null if it is not configured. For example, EnableBit is null if
the point's raw data type is FLOAT.
- ASDU: ASDU address, select from the Server
list in the IEC 104 Server configuration. Range 0-65534
- Type Id: Type ID
- startIOA: Starting IOA address, range
1-16777215
Modbus RTU Slave
- Measuring Point Name: Measuring point name
- Controller Name: The name of the controller
to which the measuring point belongs
- readWrite: read and write permission, the
value is the same as the read and write permission of the measure point in the
controller.
- Data Type: The original data type, which is
consistent with the data type of that measure point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This corresponds to the bitwise
value of the point in the controller, which is 1 if the point is enabled, 0 if
it is not enabled, and null if it is not configured. For example, EnableBit is
null if the point's raw data type is FLOAT.
- Start Mapping Address: Start address in the
registers of the Modbus RTU Slave.
IEC 101 Server
- Measuring Point Name: The name of the
measuring point
- Controller Name: The name of the controller
to which the measuring point belongs
- readWrite: read and write permission, the
value is the same as the read and write permission of the measure point in the
controller.
- Data Type: The original data type, which is
consistent with the data type of that measure point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This matches the bitwise value
of the point in the controller, which is 1 if the point is enabled, 0 if it is
not enabled, or null if it is not configured. For example, EnableBit is null if
the point's raw data type is FLOAT.
- ASDU: ASDU address, select from the Server
list in the IEC 101 Server configuration. Range 0-65534
- Type Id: Type ID
- startIOA: Starting IOA address, range
1-16777215
SL651
- Measuring Point Name: Measuring point name
- Controller Name: The name of the controller
to which the measuring point belongs
- readWrite: read and write permission, the
value is the same as the read and write permission of the measure point in the controller.
- Data Type: The original data type that
matches the data type of the point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This matches the bitwise value
of the point in the controller, which is 1 if the point is enabled, 0 if it is
not enabled, or null if it is not configured. For example, EnableBit is null if
the point's raw data type is FLOAT.
- Identifi: Feature type
HJ212 Client
- Measuring Name: The name of the measuring
point
- Controller Name: The controller
- readWrite: read and write permissions,
values to be consistent with the read and write permissions of the measure
points in the controller.
- Data Type: The original data type, which is
consistent with the data type of that measure point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This matches the bitwise value
of the point in the controller, which is 1 if the point is enabled, 0 if it is
not enabled, or null if it is not configured. For example, EnableBit is null if
the point's raw data type is FLOAT.
- Encode: The code of the monitor factor
- Block: data set
BACnet Server
- Control Name: Controller
- Measuring Point Name: Measuring point name
- Read/Write: read and write permissions,
values that match the read and write permissions of the measure points in the
controller.
- Data Type: The original data type, which is
consistent with the data type of that measure point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This is consistent with the
bitwise value of the point in the controller, which is 1 if the point is
enabled, 0 if it is not enabled, or null if it is not configured. For example,
EnableBit is null if the point's raw data type is FLOAT.
- Object Type: The object type. Analog input:
AI, analog output: AO, analog value: AV, polymorphic input: MSI, polymorphic
output: MSO, polymorphic value: MSV
- Instance Number: Instance number, range
0-511
DNP3 Outstation
- Measuring Name: The name of the measuring
point
- Controller Name: The controller
- readWrite: read and write permissions,
values to be consistent with the read and write permissions of the measure
points in the controller.
- Data Type: The original data type, which is
consistent with the data type of that measure point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This matches the bitwise value
of the point in the controller, which is 1 if the point is enabled, 0 if it is
not enabled, or null if it is not configured. For example, EnableBit is null if
the point's raw data type is FLOAT.
- Object Type: The address type of the mapped
address
- Instance Number: Mapped address
IEC 61850 Server
- Measuring Name: The name of the measuring
point
- Controller Name: The controller
- readWrite: read and write permissions,
values to be consistent with the read and write permissions of the measure
points in the controller.
- Data Type: The original data type, which is
consistent with the data type of that measure point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This matches the bitwise value
of the point in the controller, which is 1 if the point is enabled, 0 if it is
not enabled, or null if it is not configured. For example, EnableBit is null if
the point's raw data type is FLOAT.
- CDC Type: Data object type
- Data Attribute Reference: Mapping address
- Add Data Set: Add to the data set
- Data Set Name: Data set name
SNMP Agent
- Measuring Name: The name of the measuring
point
- Controller Name: The controller
- readWrite: read and write permissions,
values to be consistent with the read and write permissions of the measure
points in the controller.
- Data Type: The original data type, which is
consistent with the data type of that measure point in the controller
- Mapping Data Type: The mapping data type
- EnableBit: This corresponds to the bitwise
value of the point in the controller, which is 1 if the point is enabled, 0 if
it is not enabled, and null if it is not configured. For example, EnableBit is
null if the point's raw data type is FLOAT.
- OID: Address of OID node
- Note: The exported CSV file does not
contain information about SN and MAC
- key: Parameters
- value: The value of the parameter
Description of cloud service profile parameters
Standard MQTT cloud service
- "clouds" : Configuration information
for cloud services
- "type" : "Standard
MQTT"
- "cacheSize" : Cache size setting,
ranging from 1 to 65535
- "enable" : 0: Disable the cloud
service, 1: enable the cloud service
- "args" : set of parameters
specific to different cloud services
- "host" : server address
- "clientId" : client ID
- "auth" : 0: User authentication
is not enabled; 1: user authentication is enabled
- "username" : The username
- "passwd" : Password
- "key" : client private key
- "cert" : Client certificate
- "rootCA" : CA certificate
- "port" : Port number
- "keepalive" : to Keep Alive
- "tls" : 0: TLS encryption is not
enabled; 1: symmetric encryption; 2: asymmetric encryption
- "cleanSession" : Cleansession the
Session
- "mqttVersion" : MQTT version; V3.1
/ v3.1.1
- "tlsAuth" : authentication method
(" caSigned ": CA signature; "caSelfSigned" : CA
self-signed)
- "verifyServer" : Verifies the
server certificate
- "willTopic" : Will message Topic
- "willQos" : Will message Qos
- "willRetain" : Will message
Retain
- "willPayload" : Will message
Payload
- "rootCA_content" : CA certificate
content
- "cert_content" : client private
key content
- "key_content" : client
certificate content
- "uploadRules" : The configuration
of the upper cloud measurement point
- "quickfaas" : Message management
configuration
- "uploadFuncs" : Publish script
configuration
- "downloadFuncs" : Subscribe to
the script configuration
MQTT SparkPlugB
- "clouds" : Configuration
information for cloud services
- "type" : "Standard
MQTT"
- "cacheSize" : Cache size setting,
ranging from 1 to 65535
- "enable" : 0: Disable the cloud
service, 1: enable the cloud service
- "args" : set of parameters
specific to different cloud services
- "host" : server address
- "clientId" : client ID
- "groupId" : group ID
- "auth" : 0: User authentication
is not enabled; 1: user authentication is enabled
- "username" : The username
- "passwd" : Password
- "key" : client private key
- "cert" : Client certificate
- "rootCA" : CA certificate
- "port" : Port number
- "keepalive" : to Keep Alive
- "tls" : 0: TLS encryption is not
enabled; 1: symmetric encryption; 2: asymmetric encryption
- "cleanSession" : Cleansession the
Session
- "mqttVersion" : MQTT version; V3.1
/ v3.1.1
- "tlsAuth" : authentication method
(" caSigned ": CA signature; "caSelfSigned" : CA
self-signed)
- "verifyServer" : Verifies the
server certificate
- "willTopic" : Will message Topic
- "willQos" : Will message Qos
- "willRetain" : Will message
Retain
- "willPayload" : The will message
Payload
- "rootCA_content" : CA certificate
content
- "cert_content" : client private
key content
- "key_content" : client
certificate content
- "uploadRules" : The configuration
of the upper cloud measurement point
- "quickfaas" : Message management
configuration
- "uploadFuncs" : Publish script
configuration
- "downloadFuncs" : Subscribe to
the script configuration
Aliyun IoT
- "clouds" : Configuration
information for cloud services
- "type" : "Aliyun IoT"
- "cacheSize" : Cache size setting,
range 1 to 65535
- "enable" : 0: Disable the cloud
service, 1: enable the cloud service
- "args" : set of parameters
specific to different cloud services
- "host" : Region ID
- "connType" : Authentication type:
0: one machine one secret; 1: one type, one conntype
- "productKey" : Aliyun ProductKey
- "deviceName" : Aliyun DeviceName
- "deviceSecret" : Aliyun
DeviceSecret (one machine, one secret)
- "productSecret" : Aliyun
ProductSecret (One type One Secret)
- "thingTSL" : Ali Cloud Thing
model TSL
- "port" : port number
- "keepalive" : to Keep Alive
- "tls" : 0: off; 1: enabled
- "cleanSession" : Clears the
Session
- "mqttVersion" : MQTT version; V3.1
/ v3.1.1
- "uploadRules" : Configuration of
measuring points on the cloud
- "quickfaas" : Message management
configuration
- "uploadFuncs" : Publish script
configuration
- "downloadFuncs" : Subscribe to
the script configuration
AWS IoT
- "clouds" : Configuration
information for cloud services
- "type" : "AWS IoT"
- "cacheSize" : Cache size setting,
ranging from 1 to 65535
- "enable" : 0: Disable the cloud
service, 1: enable the cloud service
- "args" : set of parameters
specific to different cloud services
- "endPoint" : AWS IoT endpoint node
- "clientId" : client ID
- "cert" : The certificate of the
item
- "key" : The private key
- "rootCA" : CA certificate
- "port" : Port number
- "keepalive" : to Keep Alive
- "cleanSession" : To clear the
Session
- "mqttVersion" : MQTT version; V3.1
/ v3.1.1
- "rootCA_content" : CA certificate
content
- "cert_content" : The certificate
content of the item
- "key_content" : Private key
content
- "uploadRules" : Uploading cloud
measurement point configuration
- "quickfaas" : Message management
configuration
- "uploadFuncs" : Publish script
configuration
- "downloadFuncs" : Subscribe to
the script configuration
Azure IoT
- "clouds" : Configuration
information for cloud services
- "type" : "AWS IoT"
- "cacheSize" : Cache size setting,
ranging from 1 to 65535
- "enable" : 0: Disable the cloud
service, 1: enable the cloud service
- "args" : set of parameters
specific to different cloud services
- "authType" : authentication
method
- "connectionString" : Azure IoT
connection string
- "uploadRules" : configuration of
measurement points on the cloud
- "quickfaas" : Message management
configuration
- "uploadFuncs" : Publish script
configuration
- "downloadFuncs" : Subscribe to
the script configuration
Developer Guide
QuickFunction API Reference
This section describes the Python API used
internally by the gateway, which provides a set of featent-rich interfaces that
enable users to implement various operations and data processing on the gateway
by writing Python scripts. This section will provide you with the necessary
information and sample code to help you take full advantage of the features and
performance of the product.
1. Publish Measuring
Points/Alarms/Custom Data to cloud (publish QuickFunction)
- import API for publishing data to the
cloud API:
API:from quickfaas.remotebus import publish
publish(topic, payload, qos=1, wizard_data=None,
cloud_name="default")
- topic: The topic to publish the data on
- payload: The payload of the published data
- qos: The message level at which the data is
published
- wizard_data: When the first push message
fails, it is stored in the offline cache according to the topic, payload, qos
specified by wizard_data (or using the sent topic, payload, qos if wizard_data
is not specified), waiting for the connection to be restored and then uploaded
to the MQTT server in chronological order
- The wizard_data format is as follows:
{"topic":<topic>,
"qos":<qos>, "payload":<payload>}
- cloud_name: This specifies which cloud to
publish to and can be used when multiple clouds are used together
When
configuring the "publish" fast function, the message parameter of the
fast function has two formats (depending on whether it is passed to wizard_api
or not).
The entry
function contains wizard_api parameter. The following script is an example
(default script)
# Enter your python code.
import json
from common.Logger import logger
from quickfaas.remotebus import publish
def main(message, wizard_api, cloudName):
logger.debug("publish topic:%s, payload: %s, cloudName: %s" %
(__topic__, message, cloudName))
publish(__topic__, json.dumps(message), __qos__, cloud_name=cloudName)
Example of the incoming message data format:
{
"timestamp": 1713498600,
"timestampMsec": 1713498600121,
"group_name": "default",
"values": {
"Modbus": {
"word": {
"raw_data": 22,
"timestamp": 1713498592,
"status": 1,
"timestampMsec": 1713498592261
}
}
}
}
The Entry Function does not contain a wizard_api parameter,
and an example script looks like this:
# Enter your python code.
import json
from common.Logger import logger
from quickfaas.remotebus import publish
def main(message, cloudName):
logger.debug("publish topic:%s, payload: %s, cloudName: %s" %
(__topic__, message, cloudName))
publish(__topic__, json.dumps(message), __qos__, cloud_name=cloudName)
Example of the incoming message data
format:
{
"timestamp": 1713498680,
"timestampMsec":
1713498680121,
"group": "default",
"measures": [
{
"ctrlName": "Modbus",
"name": "word",
"health": 1,
"timestamp": 1713498672,
"timestampMsec": 1713498672278,
"value": 22
}
]
}
2. Update the
controller's measure-point values
Import the API for writing measure-point values:
from quickfaas.measure import write
from quickfaas.measure import write_plc_values
(recommended)
Write
- API prototype (write) :
write(message, timeout=60, cloudName=None)
- message: Write a metering point message in
the following format:
Format 1: {"measures1": 12}. If
the measurepoint name is duplicated or does not exist, an exception will be
thrown indicating that the write value has failed
Format 2: {"controller1":
{"measures1": 12}}
Format 3: [{" name ":" controller1
", "measures" : [{" name ":" measures1 ",
"value" : 12}]}]
- timeout: Write the timeout of the response
of the measure point, the default is 60S
- cloudName: It represents which cloud
platform invokes the write instruction (used to determine whether the
measurement point under the current cloud platform is blocked or renamed), optional
An example script is as follows (write) :
from common.Logger import logger
from quickfaas.measure import write
def action_name():
write_request = {"measures1": 12}
logger.debug('write plc response: %s' % write(write_request))
write_request
= {"controller1": {"measures1": 12}}
logger.debug('write plc response: %s' % write(write_request))
write_request = [{"name": "controller1",
"measures":[{"name": "measures1",
"value": 12}]}]
logger.debug('write plc response: %s' % write(write_request))
Format 1 and Format 2 return data content (write) :
[
{
"device": "controller1",
"var_name": "measures1",
"result": "OK" ,#
"OK" for success, "Failed" for failure
"error": "Success"
}
]
Format 3's return data content (write) :
[
{
"name": "controller1",
"measures":[
{
"name": "measures1",
'error_code': 0, # 0 for success, non-0 for failure
"error_reason": "Success"
}
]
}
]
write_plc_values (recommended)
API prototype (write_plc_values) :
write_plc_values(message, callback=None,
userdata=None, timeout=60, cloudName=None)
- message: Write
a measuring point message in the following format:
Format 1:
{"measures1": 12}. If the measurepoint name is duplicated or does not
exist, an exception will be thrown indicating that the write value has failed
Format 2:
{"controller1": {"measures1": 12}}
Format 3: [{"
name ":" controller1 ", "measures" : [{" name
":" measures1 ", "value" : 12}]}]
- callback:
Write the callback function to be executed when the PLC value returns
For DS1.0
compatibility, the callback function also supports three arguments
- userdata: The
parameter passed to the callback function
- timeout: The
timeout to write the response of the point, the default is 60S
- cloudName: It
represents which cloud platform invokes the write instruction (used to
determine whether the measurement point under the current cloud platform is
blocked or renamed), optional
An example script (write_plc_values) :
from common.Logger import logger
from quickfaas.measure import write_plc_values
def write_callback(message, userdata):
logger.debug("write plc response: %s, userdata:%s" % (message,
userdata))
def write_callback2(message, userdata, wizard_api):
logger.debug("write plc response: %s, userdata:%s" % (message,
userdata))
def action_name():
write_request = {"measures1": 12}
write_plc_values(message=write_request, callback=write_callback,
userdata="")
write_request = {"controller1": {"measures1": 12}}
write_plc_values(message=write_request, callback=write_callback,
userdata="")
write_request = [{"name": "controller1",
"measures":[{"name": "measures1",
"value": 12}]}]
write_plc_values(message=write_request,
callback=write_callback2, userdata="")
Format 1 and Format 2 callback functions return the data
contents (write_plc_values) :
[
{
"device": "controller1",
"var_name": "measures1",
"result": "OK" ,#
"OK" for success, "Failed" for failure
"error": "Success"
}
]
The callback function for Format 3 returns the data
contents (write_plc_values) :
[
{
"name": "controller1",
"measures":[
{
"name": "measures1",
'error_code': 0, # 0 for success, non-0 for failure
"error_reason": "Success"
}
]
}
]
3. Recall the controller's measuring point data
API to import test point data for the recall controller:
from quickfaas.measure import recall
from quickfaas.measure import recall2 (recommended)
recall
- API prototype (recall) :
recall(names=None, recall_type="measure",
timeout=10, realTime=True)
- names: List of recall names
- When
recall_type is "measure" :
None or [],
which means get all measure points from all controllers
[{"name":
"controller1", "measures": []}], to get all measures for
controller1
[{"name":
"controller1", "measures": ["measure1",
"measure2"]}], stands for getting data from measure1 and measure2
under controller1
- When
recall_type is "group" :
["group1",
"group2"] for getting data from groups "group1" and
"group2"
recall_type:
The type of data to recall
- "measure":
Recall data by measure point (if names=[], that is, if no measure name is
specified, recall all measure points on the device)
- "group":
Recall data by measure point (this mode data is uploaded via the group data
message channel)
- timeout:
recall test point response timeout, default 10 seconds
- realTime:
Whether to read real-time data, set to True will immediately re-read a recall
point and return the latest read value; Defaults to False and only works if
recall_type = "measure"
An example script is as follows (recall) :
from common.Logger import logger
from quickfaas.measure import recall
def action_name():
# Recall all measure-point data under all
controllers
logger.debug('recall all plc measures: %s' % recall())
# Recall
all measure data under the controller (controller1)
logger.debug('recall controller1 plc measures: %s' %
recall([{"name": "controller1", "measures":
[]}]))
# Recall
data from measure1 and measure2 from controller (controller1)
logger.debug('recall controller1 plc measures: %s' %
recall([{"name": "controller1", "measures":
["measure1", "measure2"]}]))
# Recall
data for groups "group1" and "group2"
recall(["group1", "group2"],
"group")
Data content to be recalled (recall) :
[
{
"name": "controller1",
"health": 1,
"timestamp": 1582771955,
"measures":[
{
"name": "measures1",
"health": 1,
"timestamp": 1582771955,
"value": 12
},
{
"name": "measures2",
"health": 1,
"timestamp": 1582771955,
"value": 1.23
}
]
}
]
recall2 (recommended)
- API prototype (recall2) :
recall2(names=None, recall_type="measure",
callback=None, userdata=None, timeout=10, realTime=True)
- names: List of recall names
- When
recall_type is "measure" :
None or [], which means get all measure
points from all controllers
[{"name":
"controller1", "measures": []}], to get all measures for
controller1
[{"name":
"controller1", "measures": ["measure1",
"measure2"]}], which means to get data from "measure1" and
"measure2" in controller1
- When recall_type is "group" :
["group1",
"group2"] for getting data from groups "group1" and
"group2"
- recall_type:
The type of data to recall
- "measure":
Recall data by measure point (if names=[], that is, if no measure name is
specified, recall all measure points on the device)
- "group":
Recall data by measure point (this mode data is uploaded via the group data
message channel)
- callback:
Callback function to execute when the data is recalled
For
compatibility with DS1.0, the callback function also supports three parameters
- userdata: The parameter
passed to the callback function
- timeout: The
timeout for the response of the recall point, 10 seconds by default
- realTime:
Whether to read real-time data, set to True will immediately re-read a recall
point and return the latest read value; Defaults to False and only works if
recall_type = "measure"
An example script is as follows (recall2) :
from common.Logger import
logger
from quickfaas.measure import recall2
def recall2_callback(message, userdata):
logger.debug("recall2 response message:
%s, userdata:%s" % (message, userdata))
def recall2_callback2(message, userdata, wizard_api):
logger.debug("recall2 response message:
%s, userdata:%s" % (message, userdata))
def action_name():
# Recall
all measure-point data under all controllers
recall2(callback=recall2_callback, userdata="")
# Recall
all measure point data under controller1
recall2(names=[{"name": "controller1",
"measures": []}], callback=recall2_callback, userdata="")
# Recall
the data from "measure1" and "measure2" in controller1
recall2(names=[{"name": "controller1",
"measures": ["measure1", "measure2"]}],
callback=recall2_callback2, userdata="")
# Recall
data for groups "group1" and "group2"
recall2(["group1", "group2"],
"group")
Data content of the recall (recall2) :
{
"timestamp": 1589507333.2521989,
"values": {
"controller1": {
"measure1": {
"raw_data": 12,
"timestamp": 1582771955,
"status": 1
},
"measure2": {
"raw_data": 1.23,
"timestamp": 1582771955,
"status": 1
}
}
}
}
4. Get global
parameters
Import the API for getting global
parameters:
from
quickfaas.global_dict import get
from
quickfaas.global_dict import get_global_parameter(recommended)
API prototype:
get()
get_global_parameter()
An example script is as follows:
from common.Logger import logger
from quickfaas.global_dict
import get
from quickfaas.global_dict
import get_global_parameter
def action_name():
logger.debug('get global dict: %s' % get())
logger.debug('get global dict:
%s' % get_global_parameter())
Returned data content:
# get interface
[
{
"key": "SN",
"value":
"GL9021025088033"
}
]
# get_global_parameter interface
{
"SN":
"GL9021025088033"
}
5. Get the
controller connection status
Import Get API to get controller connection status:
from quickfaas.controller import
get_status
from quickfaas.controller import
get_controller_status (recommended)
API prototype:
get_status(controller=None)
get_controller_status(controller=None)
An example script is as follows:
from common.Logger import logger
from quickfaas.controller import
get_status, get_controller_status
def action_name():
logger.debug('controller status:
%s' % get_status())
logger.debug('controller status: %s' %
get_controller_status())
# result: [{"name":
"dev1", "health": 0, "timestamp": 1606784851}]
Return data content:
# get_status interface
[
{
"name": "dev1",
"health": 0,
"timestamp": 1606784851
}
]
# get_controller_status
interface
{
"dev1":
{
"health":
0,
"timestamp": 1606784851
}
}
6. Get the
cloud connection status
Import Get API to get controller connection status:
from quickfaas.clouds import
get_status
API prototype:
get_status(cloud_name="default")
An example script is as follows:
from common.Logger import logger
from quickfaas.clouds import
get_status
def action_name():
logger.debug('cloud connection
status: %s' % get_status())
Return data content:
# Return True online
# Return False offline
7. Get the
global configuration
Import the API for getting global parameters:
from quickfaas.config import get
API prototype:
def get(runningConfig=True, timeout=10)
An example script is as follows:
from common.Logger import logger
from quickfaas.config import get
def action_name():
logger.debug('globle config: %s' % get())
Return data contents:
#Global JSON configuration information
8. Setting
global configuration
Import the API for getting global parameters:
from quickfaas.config import set
API prototype:
def set(config, timeout=10)
An example script is as follows:
from quickfaas.config import get, set
def action_name():
global_config = get()
#Example
Modify the global_config configuration
set(global_config)
Return data content: none
9. Read the
file in the script
Import the API for reading files:
from quickfaas.file import faas_read_file
API prototype:
def faas_read_file(filePath, mode='r',
encode='utf-8', size=-1)
filePath: the file path;
mode: mode determines the mode in which the file is opened:
read-only, write, append, etc. See the complete list of all possible values
below. This parameter is optional and defaults to read-only (r) file access
mode. This is the same as the mode parameter in python's open functional
interface
encode: This is the same encoding format as the encoding
parameter in python's open functional interface, defaulting to utf-8
size: The size to read in bytes; if size is not specified,
the whole file is returned, the same as the size parameter in python's read
functional interface
An example script is as follows:
# Enter your python code.
import json
from common.Logger import logger
from quickfaas.file import faas_read_file
def main(message):
try:
file_path = "/var/user/app/device_supervisor/test.txt"
data =
faas_read_file(file_path, mode='r', encode='utf-8')
if
data:
logger.info("data: %s" % data)
except
Exception as e:
logger.error("Exception: %s" % (e))
Return data contents:
# a string of everything in the file;
Throws an exception if an error occurs
10. Write to a
file in your script
Import the API for reading files:
from quickfaas.file import faas_write_file
API prototype:
def faas_write_file(filePath, mode='w', data='',
encode='utf-8')
- filePath: the file path;
- mode: mode determines the mode in which the file is opened:
read-only, write, append, etc. See the complete list of all possible values
below. This parameter is optional and the default file access mode is to write
only 'w'. This is the same as the mode parameter in python's open functional
interface
- data: The content (string) to be written to the file; Defaults to an
empty string
- encode: The encoding format, which is the same as the encoding
parameter in python's open functional interface, defaults to utf-8
An example script is as follows:
# Enter your python code.
import json
from common.Logger import logger
from quickfaas.file import
faas_write_file,faas_read_file
def main(message):
try:
file_path = "/var/user/app/device_supervisor/test.txt"
faas_write_file(file_path, mode='w', data="test3",
encode='utf-8')
except
Exception as e:
logger.error("Exception: %s" % (e))
Returned data content: none; An exception will be thrown if
an error occurs
11. Compatible
with DS1 API description
get_group
API prototype:
An example script is as follows:
# Enter your python code.
import json
from common.Logger import logger
def main(message, wizard_api):
# Get group
configuration
response =
wizard_api.get_group()
logger.debug("group config:%s" % response)
Returned data content:
[
{
"name": "default",
"uploadInterval": 10
},
{
"name": "group1",
"uploadInterval": 10
}
]
update_group
API prototype:
wizard_api.update_group(group_data)
An example script is as follows:
# Enter your python code.
import json
from common.Logger import logger
def main(message, wizard_api):
# update
the group configuration information
group_data
= {"group_name":"group1", "upload_interval": 10}
response =
wizard_api.update_group(group_data)
logger.debug("update group config
response:%s" % response)
Return data content:
{
"results": {
"group_name":"group1",
"upload_interval": 10
}
}
12. LwTSDB
Time Series Data General API
1.
Insert
API Prototype:
Def insert_request(table_name, insert_data, noack=0,
callback=None, userdata=None, timeout=30)
Parameter description:
- table_name: The name of the data table
- insert_data: Data that needs to be inserted
into the database
The format
is::{"<timestamp>": {"controller1":
{"measure1": [<measure1_health>, <measure1_value>],
"measure2": [<measure2_health>, <measure2_value>]}}}
- noack: whether a response is required, 0: a
response is required, 1: no response is required
- callback: the callback function of the data
return, which can be None to indicate that the returned data is not received
(this parameter is meaningful when noack is 0)
- Prototype: :d EF insert_callback(message,
userdata)
- userdata: the parameter of the callback
function (this parameter is only meaningful when noack is 0)
- timeout: the timeout period of the request
(30 seconds by default)
An example of the data returned by the
callback function
{
"return_code": 0,
"return_msg":"okay"
}
The following is an example of a script:
import time
from common.Logger import logger
from quickfaas.LWTSDB import insert_request
def insert_callback(message, userdata):
logger.debug("%s
response message:%s" % (userdata, message))
def action_name():
insert_data
= [
{str(int(time.time())): {"controller1": {"measure1":
[1, 100], "measure2": [1, "test"]}}}
]
#Insert a piece of data into the time series database
and do not require a response
insert_request('default', insert_data, 1)
#A piece of data is inserted into the time series
database and a response is required
insert_request('default', insert_data, 0,
callback=insert_callback, userdata="insert")
2. Find
API prototype:
def query_ request ( table_name , start_time =None,
end_time =None, filter=None, limit=1000, offest =0, callback=None, userdata
=None, timeout=30)
Parameter Description:
- table_name : Data table name
- start_time : start time; the format is:
%Y-%m-%d %H:%M:%S, such as: 2023-01-09 12:00:00
- end _time : End time; the format is:
%Y-%m-%d %H:%M:%S, such as: 2023-01-09 16:00:00
- filter : Get the filtering rules for data
(filter measuring point names, set black and white lists); the format is:
- {"default": " accept_all
", " black_list ": {"controller1":
["measure1", "measure2"]}, " white_list ": []}
" accept_all ": returns all
measurement points by default, except the measurement points in the blacklist ;
" deny_all ": By default, all
measurement points will not be returned, except for the measurement points in
the whitelist ;
- black_list : Blacklist measuring point name
list
- white_list : Whitelist measuring point name
list
- limit: Limit the maximum number of entries
that can be obtained at one time;
- offest : skip the number of matching
records, usually used in combination with limit;
- callback: the callback function returned by
getting the data
- Prototype: def query_ callback ( message,
userdata )
- userdata : parameters passed to the
callback function
- timeout: request timeout (default 30
seconds)
Remark:
When the start_time field is None, it means
TIMESTAMP < end_time , and the default is descending order.
When the end_time field is None, it means
TIMESTAMP >= start_time , and the default is ascending order.
When start_time and end_time are both None,
it means querying the entire data table. The default is ascending order.
the callback function :
{
"total": 1000,
"offset":
0,
"size":
100,
"data ":[
{"1669630340": {"controller1":
{"measure1": [1, 100], "measure2": [1,
"test1"]}}},
{"1669630350": {"controller1":
{"measure1": [1, 101], "measure2": [1,
"test2"]}}}
]
}
An example script is as follows:
from common.Logger import logger
from quickfaas.LWTSDB import query_request
def query_ callback ( message, userdata ):
logger.debug
("%s response message:%s" % ( userdata , message))
def action_ name ( ):
#Query all data in the default data table
query_
request ( 'default', callback= query_callback , userdata ="query")
#Query the default data table data (data after
'2023-01-09 12:00:00')
query_
request ( 'default', '2023-01-09 12:00:00', callback= query_callback , userdata
="query")
#Query the default data table data (the latest data
after '2023-01-09 16:00:00')
query_
request ( 'default', '2022-12-09 16:00:00', limit=1, callback= query_callback ,
userdata ="query")
# Query the default data table data (data before
'2023-01-09 16:00:00')
query_
request ( 'default', end_time ='2023-01-09 16:00:00', callback= query_callback
, userdata ="query")
# Query the default data table data (the last data
before '2023-01-09 16:00:00')
query_
request ( 'default', end_time ='2023-01-09 16:00:00', limit=1, callback=
query_callback , userdata ="query")
# Query the default data table data (from '2023-01-09
12:00:00' to '2023-01-09 16:00:00')
query_
request ( 'default', '2023-01-09 12:00:00', '2023-01-09 16:00:00', callback=
query_callback , userdata ="query")
# Query the default data table data (from '2023-01-09
12:00:00' to '2023-01-09 16:00:00', and filter out the measurement points with
the measurement point name "measure1")
filter = {"default": " accept_all
", " black_list ": {"controller1":
["measure1"]}}
query_
request ( 'default', '2023-01-09 12:00:00', '2023-01-09 16:00:00', filter,
callback= query_callback , userdata ="query")
# Query the default data table data (from '2023-01-09
12:00:00' to '2023-01-09 16:00:00', and only the measurement point named
"measure1")
filter =
{"default": "deny_all", "white_list":
{"controller1": ["measure1"]}}
query_request('default', '2023-01-09 12:00:00', '2023-01-09 16:00:00',
filter, callback=query_callback, userdata="query")
3. Delete
API prototype:
def remove_ request ( table_name , start_time =None,
end_time =None, noack =0, callback=None, userdata =None, timeout=30)
Parameter Description:
- table_name : data table name;
- start_time : the starting time of time
series data; when start_time is None, it means TIMESTAMP < end_time
- end_time : The deadline for time series
data; when end_time is None, it means TIMESTAMP >= start_time
- noack : whether a response is required; 0:
a response is required, 1: a response is not required
- callback: callback function for data
return; it can be None to indicate that no return data will be received ( this
parameter is meaningful only when noack is 0)
- Prototype: def remove_ callback ( message,
userdata )
- userdata : parameter passed to the callback
function ( this parameter is meaningful only when noack is 0)
- timeout: request timeout (default 30
seconds)
- Note: When start_time and end_time are None
at the same time, it means clearing the entire data table.
the callback function :
{
" return _code ": 0,
" return _msg":"okay "
}
An example script is as follows:
from common.Logger import logger
from quickfaas.LWTSDB import remove_request
def remove_ callback ( message, userdata ):
logger.debug
("%s response message:%s" % ( userdata , message))
def action_ name ( ):
# Clear the time series database data and require a
response
remove_
request ( 'default' , callback = remove_callback , userdata =
"remove")
# Clear the time series database data, no response
required
remove_request ( 'default', noack = 1)
# Delete the time series database data (from
'2023-01-09 12:00:00' to '2023-01-09 16:00:00') and require a response
remove_
request ( 'default', '2023-01-09 12:00:00', '2022-12-09 16:00:00', 0, callback=
remove_callback , userdata ="remove")
# Delete time series database data (delete data after
'2023-01-09 16:00:00'), and a response is required
remove_
request ( 'default', '2023-01-09 16:00:00', callback= remove_callback ,
userdata ="remove")
# Delete time series database data (delete data
before '2023-01-09 16:00:00'), and a response is required
remove_request('default', end_time='2023-01-09 16:00:00',
callback=remove_callback, userdata="remove")
This section describes the important topics
and payloads of the gateway's internal message bus. By reading this section,
you will understand and how specific topics and Payloads can be used for data
transfer and processing. This will allow you to use the gateway functionality
more flexibly.
1. Southbound
message bus
1.1 Topic
driver
publishes controller measurement point value:
ds2/eventbus/south/read/{driverServiceId}
- {driverServiceId}: the ServiceId of the
current driver, which can be viewed in the logs.
- The following figure shows how to view
the ServiceId of the enabled ModbusDriver (Note: The
ModbusDriver is not fixed at 2000, and the ServiceId is different depending on
the order in which the controller is enabled. Please refer to the actual
driverServiceId displayed in the logs).
Driver release
millisecond data information:
ds2/eventbus/south/upload/msec/data/{controllerName}
{controllerName}:
the name of the controller that publishes millisecond-level data
DataHub writes
the value of the measurement point to the driver:
ds2/eventbus/south/write/{requestServiceId}
{requestServiceId}:
the publisher of the message, whose ServiceId is 1010
The driver
returns the result of writing the measurement point value to DataHub:
ds2/eventbus/south/write/{requestServiceId}/response
{requestServiceId}:
the publisher of the message, whose ServiceId is 1010
Modbus
Broadcast writes:
ds2/eventbus/south/modbus/broadcast/write
1.2 Payload
1.2.1 Definition of General Southbound Point Message
Reporting Format:
{
"controllers": [
{
"name": "con1" , //
controller name
"Version" :
"d3b0c5fc05cb72e7759c95f346e29f8d", / / controller configuration
version information (virtual controller can not to this field)
"health": 1 , //
Controller health status, 1-normal, 0 -- abnormal
"timestamp": 1582771955 , //
controller health update time
"measures":[
{
"name":
"measures1" , // measure
point name
"health": 1 , //
point health status, 1 -- normal, 0 -- abnormal
"timestamp":
1582771955, // Query operation Unix timestamp
"value": 12 // The data
type is the same as the measurement point data type
}
]
}
]
}
1.2.2 General southbound millisecond point message
reporting format definition:
[
{
"controller":["con1", 1,
1646910377],
"measure": {
"mea1": [1, 100],
"mea2": [1, 100]
}
},
{
"controller":["con1", 1,
1646910377],
"measure": {
"mea1": [1, 100],
"mea2": [1, 100]
}
}
]
Notes:
controller data: controller[0] represents the controller
name, controller[1] represents the controller health status, and controller[2]
represents the acquisition timestamp
measure data: key stands for the name of the measurement
point, measure[0] stands for the health status of the measurement point,
measure[1] stands for the value of the measurement point
1.2.3 General South Point Write Value message format
definition:
{
"msg_id": 43461834341 , //
message ID
"timestamp": 1610335020088 , // timestamp
"payload": [
{
"name": "con1" , //
controller name
"measures":[
{
"name":
"measures1", // measure point name
"value": 12 // measurepoint value
}
]
}
]
}
1.2.4 Definition of general Southbound Point Write
Response message format:
{
"msg_id": 43461834341 , //
message ID
"timestamp": 1610335020088, //
timestamp
"payload": [
{
"name": "con1" , //
controller name
"measures":[
{
"name":
"measures1" , // measure
point name
"value": 12 , //
measurepoint value
"error_code": 0 , //0:
success, 1: write failed
"error_reason": "" // Description of the error reason
}
]
}
] // Load
}
1.2.5 Modbus Broadcast Write Value message format:
{
"protocol":
"Modbus-RTU" ,// communication
protocol, Modbus-RTU/Modbus-TCP
"endpoint":
"rs485" , // serial port
"slave":
1 , //
slave address
"registers":
[
{
"function": 1 , //
function code
"address": 100 , //
address
"length": 1 , //
Length
"value": "" //
Value to write to register, base64 encoded
}
]
}