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 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 btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        DCON.IO_Function.Clear_DIO_Latch(7, 1, -1, 0, 100)
    End Sub

    Private Sub btnRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRead.Click
        Dim DILatched_Value As UInteger
        Dim DOLatched_Value As UInteger
        Dim iRet As Integer

        iRet = DCON.IO_Function.Read_DIO_Latch(7, 1, -1, 4, 8, True, 0, 100, DILatched_Value, DOLatched_Value)

        If iRet <> 0 Then
            MessageBox.Show("Error " + iRet.ToString)
        Else
            TxtDILatched.Text = Hex(DILatched_Value.ToString)
        End If
    End Sub
End Class
