Transmit Data From VB2008 To Serial Port?
Mar 17, 2010when i push the button in VB, it can control other hardware which connected to serial port..
View 5 Replieswhen i push the button in VB, it can control other hardware which connected to serial port..
View 5 Repliesi am trying to write a simple programme to allow the user to open and read data from a RS232 port on a medical equipment and save the data into text file. Iam not a techie. I am totally new to programming save a few projects in foxpro(lol.....yeah oldshool).
View 4 Repliesi am a absolute beginner and i want to use vb to receive data from micro controller through serial port using rs232 standards, i found this code to receive the data serially, can any one tell me where should i paste this code, so that the data received will be displayed in message box.Private Sub DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) HandlesSerialPort1.DataReceived
[Code]...
I'm mohammed from Oman ,I'm visual studio.net programmer How I can Read the Data From Barcode Weight scales By Serial port and TcpIp port
View 7 RepliesI'm writing some VB2008 code to control four 7-seg LEDs I bought from Velleman. They came with some example code in VB 5.0, and with instructions telling me to input 5 bytes at a time in the format Chr$() & Chr$() & etc. for the rest of the 5 bytes. When I try to do this using VB2008, it rejects the $ sign, so I've tried it using the Chr() format, which VB2008 allows. However, it doesn't work. Is Chr() the new version of Chr$() or are they different entities? In sending data to the LEDs, I'm using LiveComPort.WriteLine() as my command. (My serial port is called LiveComPort) I also tried it with LiveComPort.Write() asthe command. I know that my serial port and the LEDs are working, because they respond to the demo program provided by Velleman.
View 7 RepliesThe link below has code to connect to a modem thru the serial port but it is for an earlier version of VB. when I convert the code, it does not fully convert and has 4 errors that prevent building the project. can someone tell me what needs to be changed or added?
[URL]
Note: the error: not CLS-Compliant
I am facing problem reading data from Serial port. Actually I am connecting with the hardware device called Crimp Force Analyzer. It gives the data on hyperterminal and I have to read that data from my <acronym title="Visual Basic">vb</acronym>.net program. The data is somewhat like this:
[Code]....
I'm currently working on a project where I am transmitting data from a comm device via the serial port and resorting the raw data (in binary) to its respective ascii values. The problem I'm facing is determining the most efficient method to accomplish my goal. Essentially, I have 68 bytes coming in, the first and second bytes represent the page and packet number and the data itself ranges from 3 to 64, the remaining for my checksum.
What I am needing to do is, grab 50 consecutive bytes per variable in my array, and that is where I'm confused. I have easily pulled my 3-64 bytes and stored that data to a string. I just don't know the most efficient method to accomplish my goal. Should I write directly to file all my data, as there are like 8 pages, of 128 packet data. [Code] I can capture the the first 50 by using a for-loop easily, but what would be the preferred method to track what data chunk I've taken? The more I think about it, I think I may just want to write to file, all my data, and then just take them back to back in 50 byte chunks. Is that the most efficient method?
I want to connect to serial port and get the data from that using vb.net how to do this.........
i have found one sample and i tried that but in that datareceived event is not firing
how to write code to read data from the serial port. I have a microcontroller connected to the serial port and I need the C++ program to read the input and to perform a certain task according to the information.
View 19 RepliesData Logging Through Serial Port For Gps
View 1 RepliesI want a text box in my application that will display the data currently coming from the serial port,So if i will send ascii "hello" from another computer on my program it will diaplay "hello".
View 23 RepliesI am trying to read data from rfid tag using rfid reader. i can connect reader, but cannot get data?
View 4 RepliesI am using a VB.NET(VS2010) to read data from serial port. I have 8-bit data to collect through rs232. This data is represented numbers. What reading method should I use and how to convert it to double format?
View 4 RepliesI need to read data from the serial port Ive used serialport from the toolbox , but dont know how to use it. I used to do it on a Amiga like this
open serial("serial.device".0.2400.0) rem(open port)
repeat GW.w=readserial(0)
if gw>29 and gw<128
[Code]....
I am having a little trouble receiving data via the serial port. I can send just fine. I am using Serial Port object.
Basically my data expected is in the form of: [0x43 0x35 0x64 0x35...] broken up into bytes. I tried using the SerialPort.Read() function but can't get it to work.
I am trying to recieve HEX data from a seriall device. Code is as below . but the required output is not correct. Some chracter code are not correct even in decimal . like for 80 i recieved 3F and for c0 also.for example i recived a string .
10 02 3F 00 10 03 3F 61
but in actual data should be
10 02 80 00 10 03 c0 61
[code].....
i was not getting o/p properly when i tried to receive data from serial port using the following code.
Public Class form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If SerialPort1.IsOpen Then
[code]....
i am doing a project in vb 2008 .net.during execution of the code, a different number is generated every second. the numbers are either 0,1,2,3,4, or 5. how do i send this number every second to the serial port. at the serial port i have a microcontroller connected which should accept this number and light up an LED coresponding to the number received.
View 1 RepliesI am trying to send a command through my serial port to a external device. The format of the command frame is, more or less, like this:
'0x0A 0x03 0x20 0x00 Checksum'
What I've written on my code is just this:
VB code
num_dec = &HA + &H3 + &H20 + &H0
checksum = DecToHex(num_dec) '2D
data=&HA & &H3 & &H20 & &H0
SerialPort_RFID.Write(data & checksum)
The problem is that when I stop the program on the Serial...Write line, I see that the data I sent is on integer format instead of Hex format.
I've searched in the forum thread for my needs, and I couldn't find any. So here is my problem. I need to monitor the data passing trough serial communication, between local serial port and some device with an application written in vb.netThe idea is to see the data without opening the port.For example I want to start the program, choose the serial port that I want to monitor, and then to start some other application that opens the serial port, and start to send data. Another device "answers", and I want to see the the sent and received data from the first program, and the process that opens the port.I thought that I can use the serial port event "DataReceived", but actually nothing happens. I think my approach is wrong. CHere is my code:
Imports System.IO
Public Class Form2
Private WithEvents sp As Ports.SerialPort
[code].....
I used this code in the pass with VB6 to send hex data over the serial port to a microcontroller.
MSComm1.Output = "C"
Send command ID
MSComm1.Output = Chr$("1") Send Command Parameter
MSComm1.Output = Chr$(CStr(240)) Send CR
I need to convert the code using VB2010, but Chr$ is not available, and anything I tried will not send the actual ascii code character......
the problem I am having is probably mainly because of I am very new at VB.net, anyway, the thing is, I am able to receive data from microcontroller successfully. The format of the data coming from the Microcontroller is shown below
0,2 1023,1023 1023,1023 1023,1023
1,5 1023,1023 1023,1023 1023,1023
2,8 1023,1023 1023,1023 1023,1023
[code].....
I use ReceiveSerialData() function to get a string (20 byte of 8 bit data) from serial portBut I faild and got the error "operation has timeout". I am new in VB 2010
View 10 RepliesI'm having problem while writing data to serial port. This piece of code is meant to write all the integer numbers in a text file to the SerialPort (connected to a USB-Serial Converter) when StartButton is clicked. However, it only managed to send two numbers and stopped at "USBSerialPort.Write(t, 0, 2)".
Private Sub StartButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartButton.Click
USBSerialPort.DiscardOutBuffer()
[Coe].....
I am trying to read data from serial com1 port. Now, I am not sure how to send. I found so many method to send but that are not so good and I cann't read any data. I am using VB.net 2005. Which is the best way and how can I read and send?
View 1 RepliesI just need to write data to serial port to control a toy car
Moving left, right, forward, back.
I have the following code that listens to a serial port and writes the incoming data to a listview control (the serial data are a delimited string taht arrives once per second that I parse into separate listview subitems). I would like to be able to close/disconnect the serial port once a specific value in the incoming string is detected. For example, in this case one of the columns of data in the incoming string represents depth, I would like to close the serial port when the depth falls below a given number. I have tried the code below, but my program crashes on the SerialPort.CLose method.
dim m_strOBS() as string
Private Sub SerialPort_OBS_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _
[code].....
I am trying to recieve HEX data from a seriall device. Code is as below . but the required output is not correct. Some chracter code are not correct even in decimal. like for 80 i recieved 3F and for c0 also. for example i recived a string .
10 02 3F 00 10 03 3F 61
but in actual data should be
10 02 80 00 10 03 c0 61
Public Sub DataSeriallReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort.DataReceived
Dim buff As String
[Code].....
I can read data from the serial port (GPS receiver). Its just 2 lines of data every 0.5 seconds. Whats the best method to read the data and display it in a TextBox?
If I use:
DLdate = SerialPort1.Readline()
Then I don't get the new line character, and it just over writes on just one line of the TextBox.
Also, should I time the grab of data, or is there a better way? Should I create a buffer, and when the buffer is full then do a write?