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 5 years, 2 months ago by Mikhail.