libplctag/libplctag.NET

BoolPlcMapper not returning properly

BMac099 opened this issue · 1 comments

Can't get bool to work, always returns False, other types (DINT SINT INT STRING) all work fine.

Private Sub AGVPhotoEyeState()

    Try
        Dim myTag = New Tag(Of BoolPlcMapper, Boolean)() With

{
.Name = "PROGRAM:Robot_1_Plant_AGV.AGV.R12.AGV_Detection_PE",
.Gateway = "10.1.192.18",
.PlcType = PlcType.ControlLogix,
.Protocol = Protocol.ab_eip,
.Path = "1,0",
.Timeout = TimeSpan.FromMilliseconds(5000)
}
myTag.Initialize()
myTag.Read()
Pe_state = myTag.Value
Panel1.Invalidate()

        Debug.WriteLine("AGV PE State = " & Pe_state)

    Catch ex As Exception

        Debug.WriteLine("Exeption in AGVPhotoEyeState, " & ex.Message)
    End Try

End Sub

Hi @BMac099 - there is some discourse on this subject here that may help:
#178

If the provided mappers don't do what you need, you can always create your own.