/********************************************************************** *** System function interface **********************************************************************/ #region System function private void CtrCmd_McsBuidingAndSend(int type, byte[] data) { MCS_Protocol st_mcsSend = new MCS_Protocol(); byte[] buff = new byte[128]; int length = 0; string SenString = ""; st_mcsSend.srcAddr = 0; st_mcsSend.tarAddr = 0; st_mcsSend.Frum = 0; st_mcsSend.CMD = (ushort)(CONFIG_PROJECT_PARMERT | type); st_mcsSend.DataLen = (ushort)data.Length; st_mcsSend.DataBuf = data; length = st_mcsSend.MCS_Building(st_mcsSend.srcAddr, st_mcsSend.tarAddr, st_mcsSend.Frum, st_mcsSend.CMD, st_mcsSend.DataBuf, (byte)st_mcsSend.DataLen, buff); SenString = st_Util_Proxy.ByteToString(buff, length); sendComMessage(SenString, "MCS Studio"); }
private void CtrCmd_McsBuiding(MCS_Protocol mcs) { byte[] buff = new byte[128]; int length = 0; length = mcs.MCS_Building(mcs.srcAddr, mcs.tarAddr, mcs.Frum, mcs.CMD, mcs.DataBuf, (byte)mcs.DataLen, buff); st_Serial_Proxy.SerialSend(buff, length); }
private void CtrCmd_McsBuiding(MCS_Protocol mcs) { byte[] buff = new byte[512]; int length = 0; length = mcs.MCS_Building(mcs.srcAddr, mcs.tarAddr, mcs.Frum, mcs.CMD, mcs.DataBuf, (byte)mcs.DataLen, buff); st_Serial_Proxy.SerialSend(buff, length); richTextBox_Monitor.AppendText("Send" + "\r\n"); Monitor_Display(buff, length); }
private void Mcs_ReceiveAndSendMonitor(MCS_Protocol mcs, bool mode) { byte[] buff = new byte[512]; int length = 0; if (mode == true) { richTextBox_Monitor.AppendText("Recv:" + "\r\n"); } else { richTextBox_Monitor.AppendText("Send:" + "\r\n"); } length = mcs.MCS_Building(mcs.srcAddr, mcs.tarAddr, mcs.Frum, mcs.CMD, mcs.DataBuf, (byte)mcs.DataLen, buff); Monitor_Display(buff, length); }