Imports DCON_PC_DOTNET
Public Class Form1

    Private Sub Open_Com_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Open_Com.Click
        DCON.UART.Open_Com(7, Convert.ToUInt32(9600), 8, 0, 1)
    End Sub

    Private Sub Latched_Vlaue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Latched_Vlaue.Click
        Dim Latched_Value As UInteger
        Dim iRet As Integer

        iRet = DCON.IO_Function.Read_DI_Latch(7, 1, -1, 16, False, 0, 100, Latched_Value)
        If iRet <> 0 Then
            MessageBox.Show("Error " + iRet.ToString)
        Else
            TxtValue.Text = Hex(Latched_Value.ToString)
        End If


    End Sub

    Private Sub Close_Com_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Close_Com.Click
        DCON.UART.Close_Com(7)
    End Sub

    Private Sub Clear_Latched_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Clear_Latched.Click
        DCON.IO_Function.Clear_DIO_Latch(7, 1, -1, 0, 100)
    End Sub
End Class
