public void AppendReadFromAddress(int address, int numOfBytes) { bl.Add(6); // Append address byte[] bAddress = CustomConvertorClass.ConvertIntTo4Bytes(address); bl.AddRange(bAddress); // Get and append length byte[] bLen = CustomConvertorClass.ConvertIntTo2Bytes(numOfBytes); bl.AddRange(bLen); }
/// <summary> /// Data recorder task /// </summary> /// <param name="channel"> CH0 = 0 , CH1 = 1, CH0 & CH1 = 2</param> /// <param name="opMode"> 1- continuous , 2 - target points </param> /// <param name="prescaler"> (prescaler - 1) * 10ms</param> /// <param name="targetPoints"> How much points should be recorder (not used in continuous mode)</param> public void AppendDataRecorderTask(byte channel, byte opMode, UInt32 prescaler, UInt32 targetPoints, DateTime time) { bl.Add(4); bl.Add(channel); bl.Add(opMode); bl.AddRange(CustomConvertorClass.ConvertIntTo4Bytes(prescaler)); bl.AddRange(CustomConvertorClass.ConvertIntTo4Bytes(targetPoints)); // Now append transformed time bl.Add((byte)(time.Year - 2000)); bl.Add((byte)(time.Month)); bl.Add((byte)(time.Day)); bl.Add((byte)(time.Hour)); bl.Add((byte)(time.Minute)); bl.Add((byte)(time.Second)); }
public void AppendWaitForMs(UInt32 ms) { bl.Add(3); bl.AddRange(CustomConvertorClass.ConvertIntTo4Bytes(ms)); }