Relay Board Control UK1104
Relay Board Control UK1104
Relay Board Control UK1104
Relay Board Control UK1104
Relay Board Control UK1104
Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104
Relay Board Control UK1104 Relay Board Control UK1104
Relay Board Control UK1104
Go Back  Xtreme Visual Basic Talk > > > Relay Board Control UK1104


Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2012, 04:57 PM
perlea perlea is offline
Newcomer
 
Join Date: Mar 2012
Location: Israel
Posts: 1
Default Relay Board Control UK1104


Quote:
Originally Posted by PKindermann View Post
Hi, I am very new to serial port communication using vb. I recently purchased a relay controler that uses USB virtual serial port to controll 4 relays. There are commands to turn the relalys on and off. (rel1.on rel1.off etc). These commands, as the relays themself work as I have tried them with an Emulation program (Putty).

I would like to build an interface using VB or whatever is necessary to controll these relays from buttons within a form in Access or Excel. Can someone point me into the right direction? How do I open the serial port? How do I send "rels.on" to turn on all relays, and how do I make the controler read this command.

I have found some examples that are similar to my problem. But the solutions did not work. I have also tried using matlab to open the serial port and send a command, which was received however not executed. could it be that I am sending the commands from my form and the relay board is just not executing the sent commands?

Below is a link to the manual of the device.

http://www.canakit.com/Media/Manuals/UK1104.pdf


The following is the code I have found as an example to turn on all relays (rels.on)
Code:
Option Explicit

'-------------------------------------------------------------------------------

'
' This VB module is a collection of routines to perform serial port I/O without
' using the Microsoft Comm Control component.  This module uses the Windows API
' to perform the overlapped I/O operations necessary for serial communications.
'
' The routine can handle up to 4 serial ports which are identified with a
' Port ID.
'
' All routines (with the exception of CommRead and CommWrite) return an error
' code or 0 if no error occurs.  The routine CommGetError can be used to get
' the complete error message.
'--------------------------------------------------------------------------

Private Sub CommandButton1_Click()

    Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
    Dim lngStatus As Long

    
     intPortID = 5

    ' Open COM port
    lngStatus = CommOpen(intPortID, "COM" & CStr(intPortID), _
        "baud=9600 parity=N data=8 stop=1")
        
End Sub

Private Sub CommandButton2_Click()

    Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
    Dim lngStatus As Long
    Dim strData   As String


    intPortID = 5
    strData = "rels.on"     ' cariage return? line feed? i d know
    

   'Writa data
    lngStatus = CommWrite(intPortID, strData)



End Sub

Private Sub CommandButton3_Click()

    Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
    Dim lngStatus As Long
    Dim strData   As String



    intPortID = 5
    lngStatus = CommRead(intPortID, strData, 10)

End Sub

Private Sub CommandButton4_Click()

   Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
       
       
    intPortID = 1
    Call CommClose(intPortID)
    
End Sub
I am working on a code to read the UK1104, if you have a code wich is working I would appriciate if you can share
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Relay Board Control UK1104
Relay Board Control UK1104
Relay Board Control UK1104 Relay Board Control UK1104
Relay Board Control UK1104
Relay Board Control UK1104
Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104 Relay Board Control UK1104
Relay Board Control UK1104
Relay Board Control UK1104
 
Relay Board Control UK1104
Relay Board Control UK1104
 
-->