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


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

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

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

Asp.net - Serialport Communication .net 4.0 From A Webpage?

Sep 23, 2011

Looking for serial port communication using ASP.NET 4.0. I have a cardwriter/reader from IDTECH which talks through a comport. Is there any way to accomplish with .net through the web.

I read things but most of the topics on speaking about .net 2.0 and I was not sure if they created something to handle this in .net 4.0

View 2 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 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

1 Serialport 3 Forms - Currently Attempting To Use A Module In Vb 2010 Express?

Feb 26, 2012

I 'm a beginner and have a project that I'm using to turn lights on and off. I need to use separate forms for display on remote monitors. My problem is each form needs the same serial port open to work and the port won't open unless it's closed in the previous form. Using a module works for opening and closing the port, but only for one round. If I try to revisit a form I already accessed it doesn't work.

Public Sub sp1(byval SerialPort1)If Form2.SerialPort1.IsOpen = TrueThen Form1.SerialPort1.Close() If Form3.SerialPort1.IsOpen = TrueThen Form3.SerialPort1.Close() Form1.SerialPort1.Open() end sub
Public Sub sp2(byval SerialPort1) If Form1.SerialPort1.IsOpen = TrueThen Form1.SerialPort1.Close() If Form3.SerialPort1.IsOpen = TrueThen Form3.SerialPort1.Close() Form2.SerialPort1.Open() EndSub
Public Sub sp3(byval SerialPort1) If Form1.SerialPort1.IsOpen = TrueThen Form1.SerialPort1.Close() If Form2.SerialPort1.IsOpen = TrueThen Form3.SerialPort1.Close() Form2.SerialPort1.Open() EndSub
end Module

View 2 Replies

Using Events For Communication Between Forms

Dec 4, 2009

I am bringing back here the subject of the communication between forms. The reason for this is that in a recent discussion in this forum it was conclude that using the events for communication between forms was a good practice. In a first time, I want to say, and everybody should agree with this that no form should never access directly any value or control values that belong to another form. There are many reasons for this but the principal one can be seen in this example

IN FORM1:
TextBox1.Text="CrazyPennie"
Dim MyNane as string = Textbox1.text
With this code, Form1 will expect "MyName" to have the value "CrazyPennie".

But, if Form2 does access the directly the controls of Form1, it is possible for the value of MyName to be set to something else since Form2 can have changed the value of TextBox1.Text before the assignment by Form1 to MyName. Now, what is wrong about using the events for the communication? The problem is that an event is broadcasted throughout the entire application, so the conversations in between two forms are not private.

Look at this scenario:
You have 3 forms in an application that communicate with each other with events. It is then possible for Form3 to listen to a communication between Form1 and Form2. It is also possible for Form3 to make the error to believe that the message send by Form1 to Form2 was address to itself. In this case, Form3, following this message may take some action that should not have been done and that result in some undesirable repercussion throughout the application.

This code keep the communication in between 2 forms private so no other forms or class in the application can listen at it and accidentally take an undesirable action due to a mistake.
Option Strict On
Public Class Form1
Delegate Sub MessageDelegate(ByVal sender As Object, ByVal Message As String)
Dim Form2 As New Frm2
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
[Code] .....

View 10 Replies

GPIB Communication - Sending Data - Receiving Data - Saving Data

Sep 19, 2010

I need to control a device with a GPIB port. I have the commands that I need to use to do this; but I don't know which is the sintaxis in Visual Basic.

For example if I need to send a instruction like "START:0.01" to the external device which are the libraries that I have to include?, how should I write the programming line to do this?

The main tasks that I need to program are sending data, receiving data, and saving data

View 5 Replies

C# - Serial Communication Using MSCOMM32.OCX In Forms 6i?

May 17, 2012

I want to communicate Weigh bridge with my ORACLE Form serially. I have already import MSCOMM32.OCX in my Project and On Button Pressed I wrote a Program to Start Communication between Weigh Bridge and my form. I was stuck at GET_NUM_PROPERTY of MSCOMM32.OCX Package.

View 1 Replies

Communication Between Child And Parent Forms

Oct 25, 2010

VB.NET 2003 makes it difficult to have a child button create an event on a Parent form control. I would like to change the state of a control on the parent form by using a button on the child form.

View 6 Replies

Get USB Control For The USB Port Communication? Like The SerialPort Control For The COM Port

Jul 17, 2009

Do someone know if there is a\\ USB control for the USB port communication? like the SerialPort control for the COM port.

View 2 Replies

Forms :: Serial Port Communication With PLC Machine

Nov 1, 2010

I am working on an application on serial port communication with PLC machine. Now this communication is only done with one PLC at a time. So I m sending a query to PLC and until its responds back the application goes into wait mode. i.e. no other operations can be done, and an hourglass cursor should be displayed with all other components locked on the form. So how do I achieve this using vb.net?

View 3 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

Communications :: TCP Communication - Send Data

Oct 29, 2009

I've been playing around with the TCP client/server sample code I found on [URL] but I can't seem to get it to function correctly. The problem I am having is that if I try to send data from the client a second time I get nothing back, not even an error that it couldn't send data. Every time I run the project it works the first time but that's it. When I was running the code line by line it seems to get to 'networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))' and then it jumps over the rest of the routine.

[Code]....

View 2 Replies

Data Binding And Object Communication In .NET?

Aug 12, 2011

I have a problem about button click event and data binding.I have described my problem in the mark as following

Public Class Window1
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
Dim list_of_name As New List(Of String)
list_of_name.Add("John")

[code].....

View 1 Replies

Re-create Type Of Data Communication?

Aug 20, 2010

I am re-creating a program that was made in vb6. The vb6 program used winsockets for networking. It could host up to 70 clients and there would be constant communication back and fourth. I have just recently switched to using .NET... (Huge Change) more specifically Visual Studio 2010 express (for now). asically, in effort to re-create this type of data communication I have run into a road block.

[Code]...

View 2 Replies

.net - Socket Communication - Unusual Data Being Received

Feb 24, 2011

I am trying to communicate to a local AS3 Air app on my PC via sockets. The VB.Net app is acting as a server in this case while the Air app is a client. The .Net app sends data every 25ms to the Air app. I have not send any message termination. I just receive the data on Air app and process it.

[Code]...

View 2 Replies

Download Data From GPS Logger With Serial Communication?

Jun 6, 2011

I have a gps logger which store the gps data into its internal memory .I have a description file for the data format and how to send commands to the logger to get data . this file is present at the following website L [URL]

I need to make a vb.net application that can download data from the gps logger . and to set its configuration parameters .

View 2 Replies

Serial Communication - Unable To Retrieve Data?

Apr 21, 2010

I am having some issues with serial port communication. My event handler to poll data is not working. I even tried to retrieve it using a button event, but that also does not work. I know there is data in the buffer.Here's my

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

View 13 Replies

TCP Communication - Send Data From The Client A Second Time

Oct 29, 2009

I've been playing around with the TCP client/server sample code I found on [URL] but I can't seem to get it to function correctly. The problem I am having is that if I try to send data from the client a second time I get nothing back, not even an error that it couldn't send data. Every time I run the project it works the first time but that's it. When I was running the code line by line it seems to get to 'networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))' and then it jumps over the rest of the routine.

[Code]...

View 3 Replies







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