private void SendTLPacks() { Can.TransmitData8(0x27c, new byte[] { Colored, 0, 0, 0, 0, 0, 0, 0 }); Can.TransmitData8(0x37c, new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }); Can.TransmitData8(0x47c, new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }); Can.TransmitData8(0x57c, new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }); }
private void SendTMPacks() { Byte[] s = new byte[30]; Byte[] txt = Encoding.GetEncoding("windows-1251").GetBytes(UI_TMText1.Text.ToCharArray()); for (int i = 0; i < txt.Length; i++) { s[i] = txt[i]; } Byte[] txt2 = Encoding.GetEncoding("windows-1251").GetBytes(UI_TMText2.Text.ToCharArray()); for (int i = 0; i < txt2.Length; i++) { s[i + 15] = txt2[i]; } Byte length = (Byte)((txt.Length << 4) + (txt2.Length)); Can.TransmitData8(0x27A, new byte[] { Colored, length, s[0], s[1], s[2], s[3], s[4], s[5] }); Can.TransmitData8(0x37A, new byte[] { s[6], s[7], s[8], s[9], s[10], s[11], s[12], s[13] }); Can.TransmitData8(0x47A, new byte[] { s[14], s[15], s[16], s[17], s[18], s[19], s[20], s[21] }); Can.TransmitData8(0x57A, new byte[] { s[22], s[23], s[24], s[25], s[26], s[27], s[28], s[29] }); }