Modbus modification to support simulation mode.
This commit is contained in:
@@ -52,6 +52,7 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
{
|
||||
if (modbusCommonCfg.DebugLevel == Entities.DebugMode.Simulate)
|
||||
{
|
||||
log.FatalFormat("Simulated device {0}", ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,6 +77,8 @@ namespace TBF.BenchControl.Modbus.Common
|
||||
/// <param name="message">Message incl CRC, CRC bytes dont have to be set</param>
|
||||
public void SendMessage(byte[] message)
|
||||
{
|
||||
if (modbusCommonCfg.DebugLevel == Entities.DebugMode.Simulate) return;
|
||||
|
||||
Telegram.UpdateTelegramCRC(message);
|
||||
log.Debug(Telegram.LogTelegram("Sending message ", message));
|
||||
serialPort.Write(message, 0, message.Length);
|
||||
|
||||
Reference in New Issue
Block a user