Forum Home › Forums › Communicating with Devices › Restat comminuacation line by command
- This topic has 8 replies, 4 voices, and was last updated 3 years, 9 months ago by Mikhail.
-
AuthorPosts
-
January 11, 2020 at 8:55 am #6381sananParticipant
Hi All
I’m used RapidScada for floodgate control over MQTT (under development). Sometime MQTT server restart or internet down and make connection loss.
Then I made the following formula for restaring communication number 17.
https://forum.rapidscada.org/?topic=pausestop-communication-with-device-temporarily
public bool RestartLine17()
{
string D17 = “C:/SCADA/ScadaComm/Cmd”;
string S17 = “ScadaCommCtrl”;
string R17 = “RestartLine”;
string L17 = “LineNum=17”;bool x = SaveCmd(D17, S17, R17, L17);
return x;
}Then I got error.
——————————————————————————–
——————————————————————————–
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ACT> ScadaServerService 5.1.2.1 is started
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ACT> Module is loaded from the file C:\SCADA\ScadaServer\Mod\ModAutoControl.dll
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ACT> Check the existence of the data directories is completed successfully
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ACT> Check the existence of the configuration database files is completed successfully
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ACT> Input channels are read from the configuration database. Active channel count: 46
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ACT> Ouput channels are read from the configuration database
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ACT> Users are read from the configuration database
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ACT> Formulas are read from the configuration database
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ERR> Error compiling the source code of the formulas:
Line 567, column 10: error CS0103: The name ‘SaveCmd’ does not exist in the current context
See the file C:\SCADA\ScadaServer\Log\CalcEngine.cs with the source code
2020-01-10 20:44:35 <WIN-1C2840U8DLB><SYSTEM><ERR> Normal program execution is impossible
2020-01-11 12:55:47 <WIN-1C2840U8DLB><SYSTEM><ACT> ScadaServerService is stopped
——————————————————————————–
——————————————————————————–Can someone help me What i’m wrong.
Thank you in advance.
January 13, 2020 at 12:06 pm #6397MikhailModeratorHi,
The formula is incorrect.
It’s better to fix error in KpMqtt to make it stable. Could you write here the error which is written in communication line log when connection lost?January 13, 2020 at 12:42 pm #6398greenfoxxParticipantHi!
Probably, you can see the error ‘Could not read remaining length’.
The exception occurs when there is no data to read or the connection is no longer valid.
You can test the following update https://yadi.sk/d/HPI_FkFPfrXbhAJanuary 13, 2020 at 2:18 pm #6399sananParticipantHi
Thank you so much. My error.
2020-01-13 21:17:33 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
2020-01-13 21:17:33 Error communicating with Device 42 “MQTT Test”: Could not read remaining length2020-01-13 21:17:33 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
2020-01-13 21:17:33 Error communicating with Device 42 “MQTT Test”: Could not read remaining length2020-01-13 21:17:33 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
2020-01-13 21:17:33 Error communicating with Device 42 “MQTT Test”: Could not read remaining length2020-01-13 21:17:34 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
2020-01-13 21:17:34 Error communicating with Device 42 “MQTT Test”: Could not read remaining length2020-01-13 21:17:34 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
2020-01-13 21:17:34 Error communicating with Device 42 “MQTT Test”: Could not read remaining length2020-01-13 21:17:34 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
2020-01-13 21:17:34 Error communicating with Device 42 “MQTT Test”: Could not read remaining length2020-01-13 21:17:34 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
2020-01-13 21:17:34 Error communicating with Device 42 “MQTT Test”: Could not read remaining length2020-01-13 21:17:34 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
2020-01-13 21:17:34 Error communicating with Device 42 “MQTT Test”: Could not read remaining lengthJanuary 13, 2020 at 2:34 pm #6400sananParticipantAfter replace KpMqtt.dll then look like it reconnect !
.
2020-01-13 21:32:29 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:32:32 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:32:35 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:32:37 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:32:40 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:32:42 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Send packet
Send packet
Connection established
Send packet2020-01-13 21:32:44 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet2020-01-13 21:32:45 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet2020-01-13 21:32:46 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Send packet2020-01-13 21:32:47 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet2020-01-13 21:32:49 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Send packetJanuary 13, 2020 at 2:53 pm #6401sananParticipantTry stop-start MQTT Server. It’s reconnected !
.2020-01-13 21:46:26 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet
100,5178092020-01-13 21:46:27 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Send packet2020-01-13 21:46:28 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet2020-01-13 21:46:29 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet
Error: StriderMqtt.MqttProtocolException: Could not read remaining length
at StriderMqtt.PacketReader.ReadRemainingLength(Stream stream)
at StriderMqtt.PacketReader..ctor(Stream stream)
at StriderMqtt.BaseTransport.Read()
at Scada.Comm.Devices.KpMqttLogic.ReceivePacket()
Send packet
Disconnect from MQTT broker2020-01-13 21:46:30 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:46:52 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:47:14 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:47:37 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:47:59 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:48:09 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Error reconnecting2020-01-13 21:48:11 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Send packet
Send packet
Connection established
Send packet2020-01-13 21:48:14 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet2020-01-13 21:48:15 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet2020-01-13 21:48:16 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Send packet2020-01-13 21:48:17 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
Receive packet2020-01-13 21:48:18 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
January 13, 2020 at 2:54 pm #6402sananParticipantThank you very much for your valuable support.
July 4, 2020 at 2:54 pm #6980kumajayaParticipantPlease update module repository to 5.1.0 release.
July 6, 2020 at 2:10 pm #6986MikhailModeratorDone. Thanks for noticing.
-
AuthorPosts
- You must be logged in to reply to this topic.