zhangqian
2023-10-27 d91a802e7aa2ad4075ed803b8ddc7536a91a0ef0
pkg/plc/apacheplc4x/modbusrtu.go
@@ -15,7 +15,6 @@
func newModbusRTUConnection(c *common.RTUConfig) (plc4go.PlcConnection, error) {
   ctx, cancel := context.WithTimeout(context.Background(), time.Second*3)
   // 创建一个新的 PLC 连接
   driverManager := plc4go.NewPlcDriverManager()
   connectionString := fmt.Sprintf("modbus-rtu:serial://%s?baudrate=%d&databits=%d&stopbits=%d&parity=%s", c.SerialName, c.BaudRate, c.DataBit, c.StopBit, c.Parity)
   connectionRequestChanel := driverManager.GetConnection(connectionString)
   // 等待连接响应,同时考虑上下文的超时