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 ReadDIO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReadDIO.Click
        Dim DIValue As UInteger
        Dim DOValue As UInteger
        Dim iRet As Integer

        iRet = DCON.IO_Function.Read_DIO(7, 1, -1, 4, 8, 0, 100, DIValue, DOValue)
        If iRet <> 0 Then
            MessageBox.Show("Error " + iRet.ToString)
        Else
            txtDIValue.Text = Hex(DIValue.ToString)
            txtDOValue.Text = Hex(DOValue.ToString)
        End If
    End Sub
End Class
