Imports ftdidll_RDL
Public Class Form1
    Dim Ftrdldll As New ftdidll_RDL.FT245RLRelayControl
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim SerialNo = Ftrdldll.GetDeviceSerialNo()
        Console.WriteLine(SerialNo.ToString)
        Label6.Text = $"{Label6.Text}   {SerialNo.ToString}"
        Dim rs = Ftrdldll.ConnectDevice
        If rs = 1 Then
            Console.WriteLine("Device Connected")
        Else
            Console.WriteLine("Not Connected")
        End If

    End Sub

    Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
        Dim rs = Ftrdldll.Relay1ON_4Ch
        If rs = 1 Then
            Console.WriteLine("Relay 1 ON")
        Else
            Console.WriteLine("Response 0")
        End If
    End Sub

    Private Sub button2_Click(sender As Object, e As EventArgs) Handles button2.Click
        Dim rs = Ftrdldll.Relay1OFF_4Ch
        If rs = 1 Then
            Console.WriteLine("Relay 1 OFF")
        Else
            Console.WriteLine("Response 0")
        End If
    End Sub

    Private Sub button4_Click(sender As Object, e As EventArgs) Handles button4.Click
        Dim rs = Ftrdldll.Relay2ON_4Ch
        If rs = 1 Then
            Console.WriteLine("Relay 2 ON")
        Else
            Console.WriteLine("Response 0")
        End If
    End Sub

    Private Sub button3_Click(sender As Object, e As EventArgs) Handles button3.Click
        Dim rs = Ftrdldll.Relay2OFF_4Ch
        If rs = 1 Then
            Console.WriteLine("Relay 2 OFF")
        Else
            Console.WriteLine("Response 0")
        End If
    End Sub

    Private Sub button6_Click(sender As Object, e As EventArgs) Handles button6.Click
        Dim rs = Ftrdldll.Relay3ON_4Ch
        If rs = 1 Then
            Console.WriteLine("Relay 3 ON")
        Else
            Console.WriteLine("Response 0")
        End If
    End Sub

    Private Sub button5_Click(sender As Object, e As EventArgs) Handles button5.Click
        Dim rs = Ftrdldll.Relay3OFF_4Ch
        If rs = 1 Then
            Console.WriteLine("Relay 3 OFF")
        Else
            Console.WriteLine("Response 0")
        End If
    End Sub

    Private Sub button8_Click(sender As Object, e As EventArgs) Handles button8.Click
        Dim rs = Ftrdldll.Relay4ON_4Ch
        If rs = 1 Then
            Console.WriteLine("Relay 4 ON")
        Else
            Console.WriteLine("Response 0")
        End If
    End Sub

    Private Sub button7_Click(sender As Object, e As EventArgs) Handles button7.Click
        Dim rs = Ftrdldll.Relay4OFF_4Ch
        If rs = 1 Then
            Console.WriteLine("Relay 4 OFF")
        Else
            Console.WriteLine("Response 0")
        End If
    End Sub
End Class
