public byte[] WriteBytes(byte[] sendMessage) { switch (loggerType) { case 1: sendMessage[0] = 0x02; sendMessage[1] = 0x07; sendMessage[2] = 0x02; sendMessage[3] = (byte)addressSection.MemoryNumber; sendMessage[4] = 0x3A; sendMessage[5] = (byte)addressSection.MemoryAddress; sendMessage[6] = (byte)(addressSection.MemoryAddress >> 8); return(CommunicationServices.AddCRC(7, sendMessage)); default: sendMessage[0] = 0x02; sendMessage[1] = addressSection.LengthLSB; sendMessage[2] = addressSection.LengthMSB; sendMessage[3] = (byte)addressSection.MemoryNumber; sendMessage[4] = addressSection.MemoryAddLSB; sendMessage[5] = addressSection.MemoryAddMSB; sendMessage[6] = (byte)0x00; sendMessage[7] = (byte)0x00; return(CommunicationServices.AddCRC(8, sendMessage)); } }
public byte[] WriteBytes(byte[] sendMessage) { switch (loggerType) { case 1: sendMessage[0] = 0x02; sendMessage[1] = 0x07; sendMessage[2] = 0x02; sendMessage[3] = 0x01; sendMessage[4] = 0x3A; sendMessage[5] = 0x00; sendMessage[6] = 0x00; return(CommunicationServices.AddCRC(7, sendMessage)); case 3: sendMessage[0] = 0x02; sendMessage[1] = 0x06; sendMessage[2] = 0x00; sendMessage[3] = 0x01; sendMessage[4] = 0x46; sendMessage[5] = 0x00; sendMessage[6] = 0x00; sendMessage[7] = 0x00; return(CommunicationServices.AddCRC(8, sendMessage)); case 6: sendMessage[0] = 0x02; sendMessage[1] = 0x06; sendMessage[2] = 0x00; sendMessage[3] = 0x01; sendMessage[4] = 0x63; sendMessage[5] = 0x00; sendMessage[6] = 0x00; sendMessage[7] = 0x00; return(CommunicationServices.AddCRC(8, sendMessage)); default: return(null); } }