fix
zhangqian
2023-08-28 c8b92e5482dc594c0cffdae84b883fe9c3589742
fix
2个文件已修改
22 ■■■■ 已修改文件
nsq/nsq.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pkg/plc/plc4x.go 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nsq/nsq.go
@@ -25,7 +25,7 @@
        var addressResult common.ResponsePlcAddress
        err := caller.Call(common.RequestPlcAddress{DeviceId: conf.Conf.System.DeviceId}, &addressResult, time.Second*2)
        if err != nil {
            logx.Infof("SendParams2 err: %v", err.Error())
            logx.Infof("get plc address err: %v", err.Error())
        }
    })
pkg/plc/plc4x.go
@@ -101,12 +101,12 @@
    }
    // 判断响应码是否正确
    if readResult.GetResponse().GetResponseCode("tag") != apiModel.PlcResponseCode_OK {
        fmt.Printf("error an non-ok return code: %s", readResult.GetResponse().GetResponseCode("tag").GetName())
    if readResult.GetResponse().GetResponseCode(tag) != apiModel.PlcResponseCode_OK {
        fmt.Printf("error an non-ok return code: %s", readResult.GetResponse().GetResponseCode(tag).GetName())
        return nil, nil
    }
    value := readResult.GetResponse().GetValue("tag")
    value := readResult.GetResponse().GetValue(tag)
    return value.GetRaw(), err
@@ -131,12 +131,12 @@
    }
    // 判断响应码是否正确
    if readResult.GetResponse().GetResponseCode("tag") != apiModel.PlcResponseCode_OK {
        fmt.Printf("error an non-ok return code: %s", readResult.GetResponse().GetResponseCode("tag").GetName())
        return nil, errors.New("error  code: " + readResult.GetResponse().GetResponseCode("tag").GetName())
    if readResult.GetResponse().GetResponseCode(tag) != apiModel.PlcResponseCode_OK {
        fmt.Printf("error an non-ok return code: %s", readResult.GetResponse().GetResponseCode(tag).GetName())
        return nil, errors.New("error  code: " + readResult.GetResponse().GetResponseCode(tag).GetName())
    }
    value := readResult.GetResponse().GetValue("tag")
    value := readResult.GetResponse().GetValue(tag)
    var result []byte
@@ -174,9 +174,9 @@
    }
    // 判断响应码是否正确
    if writeResult.GetResponse().GetResponseCode("tag") != apiModel.PlcResponseCode_OK {
        fmt.Printf("error an non-ok return code: %s", writeResult.GetResponse().GetResponseCode("tag").GetName())
        return "", errors.New("error  code: " + writeResult.GetResponse().GetResponseCode("tag").GetName())
    if writeResult.GetResponse().GetResponseCode(tag) != apiModel.PlcResponseCode_OK {
        fmt.Printf("error an non-ok return code: %s", writeResult.GetResponse().GetResponseCode(tag).GetName())
        return "", errors.New("error  code: " + writeResult.GetResponse().GetResponseCode(tag).GetName())
    }
    result := writeResult.GetResponse().String()