Hi, I´m using a RUT240 to send my data using the Data_to_Server function to my mqtt broker! At the moment this works periodicly! Is there a possibility to sent them by trigger too?
So I would be able to connect my broker if there is a alarm immeditly!
This depends on what information you want to send, and on what event (trigger). For example, you can configure Modbus Alarms to send a message to your MQTT broker when the value of a specific modbus register changes. More information about Modbus alarms is available here. You can also use I/O Juggler to send MQTT messages when there are I/O changes. More information is available here.
There are also SMS and Email alarm options that are available. For example, in addition to Modbus alarms and I/O Juggler, you can use Events Reporting here.
sorry for the delay!
I tried out your tipps but thats isn´t what I try to do! My favorite was the idea to use the modbus alarms! But here it isn´t possible to send the same data as I configured out in “Data to Server”!
What I like to do is: If there is a modbus alarms event then I like to sent the data I configured in " Data to Server" ! There are all the necessary informations I need!
Isnt there a possibility to do this?
This functionality isn’t supported, but there’s a workaround to consider. Keep in mind, though, that this might not be ideal for your specific use case.
To start, it’s crucial to understand that Data To Server supports various data sources. Databases are used with most of the data sources, like Modbus. The service retrieves Modbus data from the database, it does not request it directly. Modbus TCP/Serial client periodically sends requests to Modbus devices, storing this data in the database. Therefore, Data to Server doesn’t directly request Modbus data; it extracts it from the database.
Given this, there’s no direct method to send the latest Modbus data when an alarm is triggered. However, here’s an alternative you might find acceptable:
Enable the MQTT broker (allow anonymous access in Broker settings → Miscellaneous) on your RUT and add an MQTT data input in your Data to Server. Configure this MQTT data input to listen on a specific topic on the local RUT broker (127.0.0.1). Then, set up Modbus alarms to send MQTT messages to the local broker when triggered.
In this scenario, when a Modbus alarm triggers and sends an MQTT message to the broker, Data to Server will receive this MQTT message. It will then transmit data to the server using this message and any other available data at that moment. This means that if the Modbus database has relevant data, it will be immediately sent when the MQTT message is received.
It’s important to note that this assumes there is Modbus data present in the database. This approach can be useful if, for example, you have a shorter request period in your Modbus Client configuration (e.g., 30 seconds) and a longer period in Data to Server (e.g., 10 minutes). This way, if there’s data in the database, it will be sent to your server when the Modbus alarm triggers the MQTT message to the broker.