What is the meaning of the algorithm?

Forum Home Forums Development and Integration What is the meaning of the algorithm?

This topic contains 5 replies, has 2 voices, and was last updated by Mikhail Mikhail 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4883
    eurusyang
    eurusyang
    Participant

    Dear Mikhail,
    in ScadaData/ServerComm.cs,when Send network packet to ScadaServer,as shown in here:
    `int cnlCnt = curSrez.CnlNums.Length;
    int cmdLen = cnlCnt * 14 + 5;

    byte[] buf = new byte[cmdLen];
    buf[0] = (byte)(cmdLen % 256);
    buf[1] = (byte)(cmdLen / 256);
    buf[2] = 0x03;
    buf[3] = (byte)(cnlCnt % 256);
    buf[4] = (byte)(cnlCnt / 256);

    for (int i = 0; i < cnlCnt; i++)
    {
    byte[] bytes =
    BitConverter.GetBytes((UInt32)curSrez.CnlNums[i]);
    Array.Copy(bytes, 0, buf, i * 14 + 5, 4);

    SrezTableLight.CnlData data = curSrez.CnlData[i];
    bytes = BitConverter.GetBytes(data.Val);
    Array.Copy(bytes, 0, buf, i * 14 + 9, 8);

    bytes = BitConverter.GetBytes((UInt16)data.Stat);
    Array.Copy(bytes, 0, buf, i * 14 + 17, 2);
    }
    `
    I don’t know what’s the meaning?why you do that?Thanks much.

    • This topic was modified 1 month, 1 week ago by Mikhail Mikhail.
    #4890
    eurusyang
    eurusyang
    Participant

    I think high Bit and low Bit?But why?Can you explain detailed?

    #4898
    Mikhail
    Mikhail
    Moderator

    Hello,

    I hope this protocol description helps you. Please use a translator.

    #4902
    eurusyang
    eurusyang
    Participant

    thanks first ,I need some time to read,if I have problem,i will ask you.

    #4909
    eurusyang
    eurusyang
    Participant

    sorry,i do not understand,why do this process.why not send data directly.dear Makihal

    #4913
    Mikhail
    Mikhail
    Moderator

    Please specify your question.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.