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 ?
elie.karkafy
0
Junior Poster in Training
Recommended Answers
Jump to Postadd 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 …
Jump to Postyour 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)
All 7 Replies
oussama_1
39
Posting Whiz in Training
elie.karkafy
0
Junior Poster in Training
oussama_1
39
Posting Whiz in Training
elie.karkafy
0
Junior Poster in Training
oussama_1
39
Posting Whiz in Training
elie.karkafy
0
Junior Poster in Training
oussama_1
39
Posting Whiz in Training
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.