pkg/plc/plc4x.go
@@ -46,8 +46,8 @@ return conn, nil } } // 创建一个上下文,并设置 5 秒超时 ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) // 创建一个上下文,并设置 3 秒超时 ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() conn, err := NewGetModbusConnection(ctx, ipAddr) if err != nil {