Forum Home › Forums › Communicating with Devices › Modbus › Evento de perda de comunicação – Rapid SCADA 6.2.2
Tagged: Alertas, Comunicação, modbus
- This topic has 38 replies, 3 voices, and was last updated 4 weeks ago by
Mikhail.
-
AuthorPosts
-
February 26, 2026 at 8:19 pm #17685
isabellacog
Participant

Here are the channel settings.February 27, 2026 at 5:37 am #17686
manjey73ParticipantWe need to look at the logs of the Communicator and the Server, what does it say?
February 27, 2026 at 9:26 am #17689
MikhailModeratorAll values are gray. You should check that Communicator is running and the device data is being updated in Communicator.
Gray color means that data is not coming from Communicator to Server.February 27, 2026 at 11:42 am #17693isabellacog
ParticipantI disabled the device to check if the status variable would be able to identify that the device is not communicating. In other words, even when the device is not sending data, I would like a variable that can indicate this. Currently, I am using another SCADA system that checks the variable’s timestamp, and if it hasn’t changed in over 5 minutes, I receive a communication loss alarm. However, Rapid SCADA is new to me, and I am trying to set up the same alarms that I would have in my previous system, but I am still trying to understand how everything works.
February 28, 2026 at 8:43 am #17694
MikhailModeratorHow do you disable the device?
The solution depends on whether the device is in a physical error state or whether the device is disabled in the software settings.March 2, 2026 at 5:38 am #17697
manjey73Participant@isabellacog What exactly is the goal?
for example, I make a calculation channel for the input channel of the Status Communicator and make a timer script to eliminate false alarms in case of short-term reading errors.
You can also check some channel for status =4, if I’m not mistaken, and also make a timer to skip false alarms. Or without a timer, if the server sets this status only after a certain time.
March 3, 2026 at 11:35 am #17703isabellacog
ParticipantI disabled the device in the line configuration to simulate a communication error or a device fault. However, in this case, that attempt didn’t work to test the variable “status”?
March 3, 2026 at 11:35 am #17704isabellacog
ParticipantMy goal is to generate an alarm when a device stops sending data.
We are an operation center, so when a device loses communication, we must be notified immediately.
I am looking for the best way to implement this in Rapid SCADA.
The main objective is to reliably detect communication loss while avoiding false alarms caused by short-term communication interruptions.
Based on your experience, which solution would you consider the most reliable? I would appreciate it if you could provide a step-by-step guide on how to implement it.
March 3, 2026 at 11:47 am #17705
MikhailModeratorI disabled the device in the line configuration to simulate a communication error or a device fault.
This test simulates the service shutdown, but not a device failure.
To simulate a device fault, switch off the device.March 3, 2026 at 11:47 am #17706
MikhailModeratorBased on your experience, which solution would you consider the most reliable?
Using the
Statustag.March 3, 2026 at 11:54 am #17708isabellacog
ParticipantAlright, I will temporarily disable our VPN to interrupt communication and simulate a real communication failure with the device.
Please confirm if this is correct.For the configuration:
Data Type: Double (or should it be Integer?)
Channel Type: Input (or should it be Calculated?)
Tag Code: Status
Formula enabled: No
Input formula: EmptyMarch 3, 2026 at 12:00 pm #17709
manjey73ParticipantThe service channel with the Status tag works only when the Communicator starts one or another driver. When polling is turned off, this channel does not work.
Probably using the Status signal from the Communicator when the line is running. But in principle, no one prevents you from duplicating the status of the channel(s) when the server turns it into an invalid state and turns it gray (you need to see what kind of status number it becomes, but it seems to be 4)
My solution is on an additional calculation channel with a timer.
For example, we added input channel 110 to the Device with theStatustag code.I am adding an additional channel 111 – Calculated – The input formula for the TON timer
TON(ValRel(-1), 2, Val(), "m")TON(IN, PT, Q, “min”) – IN – The value of the controlled channel can be explicitly specified as Val(110)
PT – A unit of time, for example, if in minutes 2
The Q channel for the control output, if the formula is used by itself, it is necessary to specify the current channel Val() – these difficulties appeared when I had to make two timers in one formula, more on that later
“m” – Specifies what the units of time are s, m, h, or sec, min, hour are allowed -see the formula
The timer index can be omitted when used in the
channel, by default = 0. If you use multiple timers inside other functions, you can use multiple timers by adding indexes to them and assigning internal variables to them.The formula in the Script table
// IEC timers and others public static long Ticks() { DateTime now = DateTime.Now; long time = now.Ticks/10000; return time; } protected class UtilTimer { public long et; public bool flag; public bool q; } protected Dictionary<string, UtilTimer> TonTimer = new Dictionary<string, UtilTimer>(); // Timer with a delay of turning on TON public double TON(double IN, double PT, double Q, string str = "", int idx = 0) { var ut = new UtilTimer() {et = 0L, flag = false, q = false}; string keys = $"{CnlNum}_{idx}"; // The key is the channel number plus the timer index, zero by default. long ET = 0L; long _pt = Convert.ToInt64(PT); bool q = Q > 0; bool _in = IN > 0; string s = str.ToLower(); if (s == "s" || s == "sec") _pt = Convert.ToInt64(PT) * 1000; if (s == "m" || s == "min") _pt = Convert.ToInt64(PT) * 60000; if (s == "h" || s == "hour") _pt = Convert.ToInt64(PT) * 3600000; if (!TonTimer.ContainsKey(keys)) { TonTimer.Add(keys, ut); } if (!_in) { TonTimer[keys].q = false; TonTimer[keys].flag = false; TonTimer[keys].et = 0L; } else { if (!TonTimer[keys].flag) { TonTimer[keys].flag = true; TonTimer[keys].et = Ticks(); } else { if (!q) ET = Ticks() - TonTimer[keys].et; } if (ET >= _pt) q = true; TonTimer[keys].q = q; } q = TonTimer[keys].q; return Convert.ToDouble(q); }// Returns the channel value relative to the current channel. public double ValRel(int offset) { return Val(CnlNum + offset); }And now we are setting up some other actions for the channel channel with a timer.
When using the Automatic Control Module, you can do without these formulas, but for me it is not always convenient. Moreover, I use the timer for solving other tasks.March 3, 2026 at 1:06 pm #17710isabellacog
ParticipantThanks, the Status channel worked correctly when I simulated the communication failure by disabling the VPN.
https://imgur.com/Nn6EK6r Status worksI really liked the timer idea. However, I was not able to implement the script correctly. It is showing an error when I try to save it.
https://imgur.com/dCw3PT1 error 1
https://imgur.com/o4mia9r error 2
https://imgur.com/9b7maP8 channel configurationCould you please help me identify what I did wrong?
Below is the code I added to the Script Table:
`// IEC timers and others
public static long Ticks()
{
DateTime now = DateTime.Now;
long time = now.Ticks/10000;
return time;
}protected class UtilTimer
{
public long et;
public bool flag;
public bool q;
}protected Dictionary<string, UtilTimer> TonTimer = new Dictionary<string, UtilTimer>();
// Timer with a delay of turning on TON
public double TON(double IN, double PT, double Q, string str = “”, int idx = 0)
{
var ut = new UtilTimer() {et = 0L, flag = false, q = false};
string keys = $”{CnlNum}_{idx}”; // The key is the channel number plus the timer index, zero by default.long ET = 0L;
long _pt = Convert.ToInt64(PT);
bool q = Q > 0;
bool _in = IN > 0;
string s = str.ToLower();if (s == “s” || s == “sec”) _pt = Convert.ToInt64(PT) * 1000;
if (s == “m” || s == “min”) _pt = Convert.ToInt64(PT) * 60000;
if (s == “h” || s == “hour”) _pt = Convert.ToInt64(PT) * 3600000;if (!TonTimer.ContainsKey(keys))
{
TonTimer.Add(keys, ut);
}if (!_in)
{
TonTimer[keys].q = false;
TonTimer[keys].flag = false;
TonTimer[keys].et = 0L;
}
else
{
if (!TonTimer[keys].flag)
{
TonTimer[keys].flag = true;
TonTimer[keys].et = Ticks();
}
else
{
if (!q) ET = Ticks() – TonTimer[keys].et;
}
if (ET >= _pt) q = true;
TonTimer[keys].q = q;
}
q = TonTimer[keys].q;
return Convert.ToDouble(q);
}// Returns the channel value relative to the current channel.
public double ValRel(int offset)
{
return Val(CnlNum + offset);
}-
This reply was modified 1 month, 1 week ago by
Mikhail.
March 3, 2026 at 8:37 pm #17712
manjey73ParticipantStrangely, I copied these scripts to a new project, and there were no similar errors with saving XML.
March 3, 2026 at 8:46 pm #17713
manjey73ParticipantYou may have picked up extra characters. You need to make copies of windows framed with the CODE tag. For example, if you copy the code that you copied here, we get an error because the site changes some characters to others.
-
This reply was modified 1 month, 1 week ago by
-
AuthorPosts
- The topic ‘Evento de perda de comunicação – Rapid SCADA 6.2.2’ is closed to new replies.