xxe 2 years ago
parent
commit
07e047e65b
1 changed files with 13 additions and 7 deletions
  1. +13
    -7
      HKCardOUT/ViewModels/RootViewModel.cs

+ 13
- 7
HKCardOUT/ViewModels/RootViewModel.cs View File

@@ -86,14 +86,20 @@ namespace HKCardOUT.ViewModels
HandyControl.Controls.Growl.InfoGlobal(ex.Message);
}
}), "循环状态监测线程", false);
// 初始化 串口
UHF_RS485_Helper.GetInstance().Open(new SerialParam
try
{
PortName = DataBus.COM,
BaudRate = 57600,
DataBits = 8
});

// 初始化 串口
UHF_RS485_Helper.GetInstance().Open(new SerialParam
{
PortName = DataBus.COM,
BaudRate = 57600,
DataBits = 8
});
}
catch (Exception)
{
HandyControl.Controls.Growl.WarningGlobal("未接入相应设备");
}
if (!UHF_RS485_Helper.GetInstance().GetSerialPortState())
HandyControl.Controls.Growl.InfoGlobal("串口打开失败");
//读取读卡器


Loading…
Cancel
Save