VS 2008 IO.Serialport Does Not Receive Any Data

Apr 6, 2009

I want to use IO.ports.serialport to receive ASCII data from an instrument (A Luxmeter for those interested). So far, i've been unable to read any single byte from the instrument using the IO.ports.serialport.A terminal window shows the datastream just fine, and I've used MScommlib to read the data without problems. I just had other problems with the latter, so I thought I'd give this IO.ports.serialport a try.The code runs fine, no errors. It just doesn't receive anything.Bytestoread stays 0 forever.I distilled the code to it's bare essence. What am I missing? Is it something obvious, or did I completely misunderstand the whole concept? (Which is not unlikely..)I did check the obvious, of course: settings, baudrate, cable is connected, instrument is sending, etc.[code]

View 6 Replies


ADVERTISEMENT

Serialport To Receive Data From Instrument Every Second?

Jul 18, 2009

I use the vb .net serialport to receive data from my instrument every second

View 11 Replies

Forms :: Serialport Communication - Receive Data To Pc From External Hardware

Sep 5, 2009

i want to receive data to my pc from external hardware but i don't know how to do it since i am new to vb.net. the code in vb.net to receive data using serial port rs232.

View 1 Replies

Receive Data From Serialport & Send It To Anthor Pc Running My Program?

Sep 3, 2010

how to recive data from serialport & send it to anthor pc running my program & resend to the same serialport on the other pc?

View 4 Replies

SerialPort Can't Handle Or Receive Interruption In DLL

Feb 10, 2012

I am writing VB.NET codes in both Window form and DLL.

In the Window form program, no problem I have. She can open serial ports, write, and handle receive interruption with the code below[code]...

View 11 Replies

VS 2008 - Chat - Client Doesn't Receive The Data

Sep 16, 2010

Im working on this one application/chatter. What it does, theres a server, and lots of clients. Client sends data to server, server process's it, and the client receives the data (unless its a command, like /process username). Heres my problem. My client has a login feature, like yahoo. Client sends username/password to server. Server goes through list of usernames. Then sends it to client, wether it matches. But my client doesn't receive the data. Can anybody fix this, with my client code provided? Let me know if you need server code, and the extra script files/vb files. [Code]

View 5 Replies

Reading Data Using SerialPort Object?

Mar 7, 2012

I develop a simple application usiing VB.NET, VisualStudio 2008, that read input from a serial port

(from another device). I use the class SerialPort.

Using HyperTerminal I can see the input , it's fine. looks like :

S0P,A,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0 S0P,A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

[Code]...

View 5 Replies

SerialPort.DataReceived Not Returning Data?

Dec 29, 2010

Every 5 to 10 seconds I receive 5-12 bytes of data (confirmed w/Hyperterminal). I can open the com port(btn1), read bytes(btn3) until bytes to read = 0, but then i'm stuck; the data received event doesn't seem to respond. If I close the serial port(btn2), re-open i can read more data until bytes to read = 0 then stuck again. I tried several suggestions for threads and delegate and invoke but none worked. (WIndows XP, VB 2008)

[Code]...

View 19 Replies

Communications :: Serialport Data Received Addhandler

Apr 24, 2010

I am writing a small application to see what data I am sending and receiving to my COM port (for a small hardware project based on url..).The problem I want to activate a "Serialread" or "SerialWrite" procedure as soon as data is waiting in the receive or send buffer.I have some basic skills so before I start digging in I would like to get some advice. Can I use a addhandler (I have read something about this on the internet but have to clue how to use it) or something else? Is there a way to check if data is in the buffer ready to be read or write??

View 2 Replies

Save Data And Send To Serialport Periodically?

Oct 14, 2009

I have a program where I need to periodically save the data to a database (if the computer suddenly shutdown) and also send the same data to a serialport.Alla data that is going to be sent and saved resides in two classes.his needs to be done every 1/10s.What's the best way to manage this?

View 2 Replies

.net - SerialPort Reads Are Returning Fragmented Sets Of Data?

Oct 17, 2011

I have a USB device which creates a Virtual Serial Port on Windows. I am using VB.Net to write and read from the port. My device responds with specific sized set of bytes, but I am finding that SerialPort.Read(byte-array,offset,number-bytes) does not return the full number-bytes but it also does not timeout or generate an exception. Repeated calls return additional fragments (up to 3 calls required). Python code using pySerial does not have the same problem.So, what am I doing wrong here? Am I expecting too much?

Some scenarios are:I write a command to the port and expect to get 4 bytes in response. I get 1 byte first and then 3 bytes on the subsequent call.I write a command and expect 21120 bytes in response. I get 1, 12671 and then 8448 bytes in 3 calls to read from the port.

Here are some excerpts from my code:

Private Sub SetupVirtualSerialPort()
Dim portName As String = "COM" + (m_DeviceContext * -1).ToString
Const baud As Int32 = 9600 '7680000
Const parity As Parity = parity.None

[code]....

View 2 Replies

Make A Simple Class That Reads Data From A SerialPort

Aug 17, 2009

I'm trying to make a simple Class that reads data from a SerialPort.The Device returns a number of lines of Strings.[code]However running this code in a Form with one TextBox Control (txtLog) Allways results in the "The operation has timed-out." Exception.[code]

View 3 Replies

'System.StackOverflowException' When Writing Data To SerialPort At Higher Baudrates?

Nov 24, 2010

I am writing a serial application using VB .net Framework V4 , where I use a background worker to Read a file and send it to a serial port using SerialPort1.writeLine method. The BackgroundWorker1.ProgressChanged Event handler sub Updates the Line Number to a TextLabel and adds each line sent to a RichTextBox using RichTextBox1.AppendText() method on main form (Form1).

The problem arises at 115200 Bauds (and higher),may be because now the text is updated real fast on the form an unhandled Exception in BackgroundWorker1.ProgressChanged Event handler sub occurs. Otherwise at lower baudrates ex: 9600,19200 etc. Application Runs Perfectly Fine.

[Code]...

View 6 Replies

Receiving Invalid Data From Serial Port Using SerialPort.ReadExisting

Jan 16, 2010

Recently we have connected one bluetooth device which receive data from our serial device. The bluetooth device further transmite this data to a Windows Mobile which is bluetooth enable. Baud rate of whole system is 19200 with 7 data bit and 1 stop bit.When we send command to serial device through bluetooth device it is accepting the command and respond accordingly. but some of data byte of string is desplay as question mark (?).But in case we connect the serial device directly to PC, the string received is correct.[code]Response given by Serial Port is "?09?D03?A D?

View 1 Replies

Receiving Invalid Data From Serial Port Using SerialPort.ReadExisting()

Jan 16, 2010

Recently we have connected one bluetooth device which receive data from our serial device. The bluetooth device further transmite this data to a Windows Mobile which is bluetooth enable. Baud rate of whole system is 19200 with 7 data bit and 1 stop bit.When we send command to serial device through bluetooth device it is accepting the command and respond accordingly. but some of data byte of string is desplay as question mark (?).[code]...

View 4 Replies

VS 2008 PDA SerialPort?

Jun 23, 2010

I have wrote this program (for PDA), to connect a PDA to the PC via RS232.It only works half way.

If I send anything from the pda to the pc, I receive data correctly.If I send anything from the pc, then the pda hangs up.Can anybody tell me what I'm doing wrong?

Also, how do I make sure the port on PDA is closed when quitting the application?

[Code]...

View 1 Replies

SerialPort Escape String - Retrieving Data From A Device Connected To A Virtual Com-port

Aug 13, 2010

I am writing a small app that is retrieving data from a device connected to a virtual com-port. I connect without problems to the device using the settings 9600-8-N-1.

I need to send the command <esc>MS , the device then sends back the data to a computer. I have tried this using Hyperterminal with success. I also did this with Excel and VBA. I used the MSComm32 Active X control:

MSComm1.Output = Chr$(27) + "M" + "S" + Chr$(13)

Msgbox(MSComm1.Input)

This made the data from the device pop up in a messagebox. I am writing a winforms app in vb.net, using VS2005. I have a form, on which I have a Placed a SerialPort control, named sp. My sample code is as follows:

Private Sub Form1_Load(ByVal
sender As System.Object,
ByVal e

[CODE]...

This returns the error message "Error: expecting a command". I have done som tests in HyperTerminal, and have concluded with:

-If I dont send <esc>, I get error "Expecting a command"

-If I send wrong command (ie MD instead of MS) i get error "Bad command"

Based on this, I suspect that I don't pass the escape character correctly to my device. So I wonder how to do this?

View 5 Replies

VS 2008 - Excel And Data Grid - Importing An Excel Into A Data Grid - Receive The Value "null"

Mar 10, 2010

I have a problem with importing an excel into a data grid.

Here is my code:

Try
Dim _Obj As New ExcelConnection.ExcelConnection
_Obj.ImportAttendence("c:Info_pc.xls", DataGrid1)
Catch ex As Exception

End Try

In the excel i have numers and text and "Service Pack", "Processor Speed" and "Numar procesoare(Number of processors)" and the values for these are numers. in the data grid when i import the excel those values doesn't appear, i receive the value "null".

View 7 Replies

VB 2008 On XP Exception With Serialport?

Mar 14, 2009

I am trying to access a printer via the serial port in VB Express 2008. I wrote a small prog with buttons on the form to exercise the escape codes in a Windows Vista 32 laptop with a USB to serial adapter. Only 3 codes worked, BEL, reset and a printer specific command. Also, when i try to receive data, it justs times out. So, I tried to move to a WinXP machine with real serial ports. The program now has an illegal argument exception and the message is to the effect that the name of the port for the property portName does not start with COM/com. Which is very puzzling because I did verify the portname and it is com1.Is this a known issue or am I doing something wrong? The form works on Vista but not in XP.

[Code]...

View 8 Replies

VS 2008 SerialPort Hang-up?

Jun 23, 2010

I am trying to send and receive data using the SerialPort component. I am sending data to an Texas Instruments MSP430 which simply echos the sent character. I wanted my VB solution to read characters from a file, send a single character, and wait until the echoed character is received before sending another.

I have been fairly successful thus far but I have run into a little catch. When I attempt to send large files (323505+ characters) my MSP430 just hangs there and will not receive any more characters. My VB app return to VS '08 with timeout errors (timeout set to 1 minute).

I wanted to post my VB code here to see if the problem is from my VB app. I will be posting this problem on the IT usergroup to sort out anything on the MCU end. Here is the pastbin of the data write and the data receive subs:[URl]..

View 2 Replies

VS 2008 Using Serialport On 2 Different Forms?

Aug 25, 2009

I'm using one form to make contact with the serial port with the next

Imports System.IO.Ports
Imports Microsoft
Public Class Menu

[Code].....

View 2 Replies

Receive XML Data Via URL

Aug 29, 2011

Am told to receive XML data via URL. Can someone suggest the best way to achieve this without any authentication required at the level of server. Best Regards, Harikrishnan R

View 3 Replies

VS 2008 - Warning - Serialport.encoding

Jul 7, 2009

My program has been running fine for months and still is, but I now have this warning, (which must have shown up since upgrading to VB2008 from 2005 a month ago).

It regards the serial port encoding setup and reads as follows -- serialport1.Encoding = encoding.GetEncoding(1252) 'for char > 127

Warning 1Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. Perhaps there was an update on this with 2008 and it's now redundant or something?

View 4 Replies

[2008] SerialPort Blue Screen?

Jan 22, 2009

I was attempting to clean up my serial port example that is in the code bank. I had decided to use a modem, thinking that a lot of computers still had them. By using the loopback feature of the modem I am able to simulate / emulate various features of the serial port.All was going well, and then I got a Blue Screen with this error after running for 10 minutes or so:DRIVER_IRQL_NOT_LESS_OR_EQUALSTOP 0x000000d1 etc.I then went back to using my GPS receiver, which sends messages constantly to a serial port. This test ran for several hours(4). It received messages correctly during the entire test.I then created a new, not as complex, version and it also receives the Blue Screen. I have made sure that the modem drivers are up to date, searched for the error, etc. My gut is telling me that it is the modem driver. I have attached the project. This is the scaled back version, but it uses the same functionality.

View 7 Replies

Can't Receive Data Using Winsock

Jul 20, 2009

I'm working on a server/client chat program in vb 2008 using winsock. I have a connection and can send data, but for some reason I can't receive data. [Code]

View 2 Replies

Parse(receive) The Data From The PBX Itself?

Feb 3, 2012

have to write a program/application (which I already started in VB.NET 2010) that connects through Panasonic KX-TEM824 PBX machine via RS232 port (cable already connected : COM15/16 depending on USB I connect) and while it's connected to parse(receive) the data from the PBX itself, data that has caller ID, time of call started and ended, duration of the call and etc. I have found some already application on the Internet that does the work but they are free to try after awhile requires to buy or restart the app again. But I assume there's not much to implement on the code side.

Imports System
Imports System.ComponentModel
Imports System.Threading [code]..

View 7 Replies

VS 2008 Creating Dynamic SerialPort Controls

May 31, 2009

I need to create some serial port controlls manually. My program reads through a config file, and it if comes across an entry called COMPORT then I need to create a contol to talk to this port. The entries in the ini file might be

COMPORT=COM1
COMPORT=COM3
COMPORT=COM7

So here is my problem! I'd like to create the variable control name with part of the com port number, so I can always refer back to it.
EG.

Dim strVar as sring = "COM1"
Dim CName+strVar As New System.IO.Ports.SerialPort

View 1 Replies

VS 2008 Get Response From Serialport To Update Property?

Feb 19, 2011

There is a problem in my project. It has a class with several properties. When I set the property, it send command to device through serialport. But the problem is when I get the property, it need to send request command to device, and device return value back. How can I update the property?

View 2 Replies

VS 2008 SerialPort Custom NewLine Character?

May 21, 2010

I have this sample code...

Private Sub DataReceived( _
ByVal sender As Object, _
ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _

[code]....

this displays in a text box the received data from a serial port. And it works like a charm but the data received has custom start and end of line characters. A line begins with chr(&H2) and ends with chr(&H3). What i want is on the text box those characters to be hidden and the chr(&H3) to start a new line.

View 5 Replies

Split The Data And Receive Back From The Box?

Nov 5, 2010

I am writing an automation program for an associated research HYPOT tester and one of my current problems is trying to split the data i recieve back from the box.Currently i have two commands i use TD? and SALL? both do the same thing but return different data. TD? when sent to the box will return the test results and of course there is no auto return when test is complete so i have to either set some kinda of timer to get the data after the test is complete or just keep pinging the box tell the test returns with either a pass or fail.my problem is when i ping the box with TD? it returns

"M11,ACW,test results{pass|fail},1.50,10.00,10ms"

What I am trying to do is use a split command to split that line into strings based off "," as my dilimeter. Currently i am useing this set up

dim resultstring as string = main.serialport1.readexisting
dimresultarray as string = split(resultstring, ",",6)
txtTestResult.Text = resultarray(2)

for the most part is does return the test results but other times it will either error out saying that resultarray(2) is out side the index or it will display one of the other strings (acw or 1.50).Is there a more accurate way to do this.I am also printing the full string pulled from the buffer into a text doc as a data log.

View 15 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved