Restat comminuacation line by command

Forum Home Forums Communicating with Devices Restat comminuacation line by command

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #6381
    Avatarsanan
    Participant

    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.

    Forum Home

    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.

    #6397
    MikhailMikhail
    Moderator

    Hi,

    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?

    #6398
    greenfoxxgreenfoxx
    Participant

    Hi!
    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_FkFPfrXbhA

    #6399
    Avatarsanan
    Participant

    Hi

    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 length

    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 length

    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 length

    2020-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 length

    2020-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 length

    2020-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 length

    2020-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 length

    2020-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 length

    #6400
    Avatarsanan
    Participant

    After 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 reconnecting

    2020-01-13 21:32:32 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:32:35 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:32:37 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:32:40 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:32:42 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Send packet
    Send packet
    Connection established
    Send packet

    2020-01-13 21:32:44 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Receive packet

    2020-01-13 21:32:45 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Receive packet

    2020-01-13 21:32:46 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Send packet

    2020-01-13 21:32:47 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Receive packet

    2020-01-13 21:32:49 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Send packet

    #6401
    Avatarsanan
    Participant

    Try 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,517809

    2020-01-13 21:46:27 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Send packet

    2020-01-13 21:46:28 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Receive packet

    2020-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 broker

    2020-01-13 21:46:30 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:46:52 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:47:14 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:47:37 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:47:59 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:48:09 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Error reconnecting

    2020-01-13 21:48:11 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Send packet
    Send packet
    Connection established
    Send packet

    2020-01-13 21:48:14 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Receive packet

    2020-01-13 21:48:15 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Receive packet

    2020-01-13 21:48:16 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Send packet

    2020-01-13 21:48:17 Communication session with the Device 42 “MQTT Test”, type: KpMqtt
    Receive packet

    2020-01-13 21:48:18 Communication session with the Device 42 “MQTT Test”, type: KpMqtt

    #6402
    Avatarsanan
    Participant

    Thank you very much for your valuable support.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.