i need to develop a software in which i can connect to a handpunch1000 throug vb.net and collect data , i am using visual studio 2010 any help ?

Dani AI

Generated

Two realistic integration routes and which one fits this thread (HandPunch 1000 behind an RS232->Ethernet box at 192.168.1.14):

  • Use the vendor/OS-level integration first if available. Recognition/HandPunch terminals speak RS‑232 to a host; some models (1000E and later) include Ethernet. The device manual documents the RS‑232 host interface and menu items for serial/network setup. (HandPunch 1000 manual). (manualslib.com)
    The 1000E is explicitly described as having Ethernet options in manufacturer material. (HandPunch 1000E spec). (handpunch.com)

  • If the terminal is connected through a serial-to-Ethernet converter, treat the converter as either (a) a transparent TCP/UDP bridge or (b) a provider of a virtual COM driver. Many device servers support TCP server/client, UDP and a virtual‑COM utility (check the converter manual for its configured port/mode). (example serial-to-ethernet converter info). (sourcewell.in)

Practical checklist and options (grounded in the posts from and ):

  1. Identify the converter model and the TCP port/mode (TCP server vs client vs HTTP). Test with ping / PuTTY (raw TCP) or telnet to IP:port to see if a connection is accepted.
  2. If the converter exposes a virtual COM port on the PC, the SerialPort approach that @oussama_1 suggested will work unchanged.
  3. If the converter is a raw TCP bridge, a raw socket (TcpClient) is needed in VB.NET (WebClient.DownloadString is only for HTTP and will not work for raw serial bridges).

Example VB.NET pattern (raw TCP read + save to file — replace PORT with the converter port and adjust encoding/parsing to match the device protocol):

Dim ip As String = "192.168.1.14"
Dim port As Integer = PORT ' set to converter's TCP port
Dim client As New System.Net.Sockets.TcpClient()
client.Connect(ip, port)
Using ns As System.Net.Sockets.NetworkStream = client.GetStream()
    Dim buf(4095) As Byte
    Dim ms As New IO.MemoryStream()
    Dim read As Integer
    Do
        read = ns.Read(buf, 0, buf.Length)
        If read > 0 Then ms.Write(buf, 0, read) Else Exit Do
    Loop While ns.DataAvailable
    Dim text As String = System.Text.Encoding.ASCII.GetString(ms.ToArray())
    IO.File.WriteAllText("C:\handpunch\export.txt", text)
End Using
client.Close()

Other helpful points:

Next logical steps based on the thread: confirm the converter model and its configured TCP port/mode, try a raw telnet/PuTTY connection, capture the vendor software traffic (Wireshark) if needed, or request the vendor SDK/DLL to avoid low‑level parsing.

Recommended Answers

All 7 Replies

add a serialport to your form select your handpuch port

ComboBox1.Items.AddRange(IO.Ports.SerialPort.GetPortNames)
SerialPort1.PortName = ComboBox1.SelectedItem.ToString

open it

SerialPort1.Open()

Receive data and convert

Private Sub DataReceived(ByVal sender As Object, _
                      ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _
                      Handles SerialPort1.DataReceived
        If SerialPort1.BytesToRead > 0 Then
        SerialPort1.Read(your data)
        end if
        'convert bytes to plain text
        System.Text.Encoding.ASCII.GetString(your data)

good luck

what you mean by your data , can you give me an example ? if i want to collect a txt file from the handpunch , one more thing the hand punch is connected ethernet throug a converter from serial to network

your data: the data received from handpunch

        If SerialPort1.BytesToRead > 0 Then
            Dim buff(SerialPort1.BytesToRead - 1) As Byte
            SerialPort1.Read(buff, 0, buff.Length)
            Me.BeginInvoke(New myDelegate(AddressOf SerialPortDelegate), buff)
        End If

  Public Delegate Sub myDelegate(ByVal buff() As Byte)


   RichTextBox1.Text = System.Text.Encoding.ASCII.GetString(buff, 0, buff.Length)
            RichTextBox1.SaveFile("your path\filename.txt", RichTextBoxStreamType.PlainText)

dunno oussama run this code i am confused a little , my handpunch is connected to a converter that have an ip ( 192.168.1.14) , i want to collect the data from my hand punct throug network

oh! ok try this

 Dim handpunchdata As String = New System.Net.WebClient().DownloadString(ip)

if that doesn't work i need to see a sample of your data (i mean is it a binary or hex...)

you remmenber the txt file i showed you for the import issue ? this txt file exported through a software that can connect to the handpunch , but i am trying to develop a similar software in vb

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.