Change Code For Communication USB Port In Program6 To NET?
Nov 25, 2009I have 1 project to comunication with usb port in VB.NET.But now,i have code VB6 and then i want to change the code VB6 to VB.NET.[code]....
View 4 RepliesI have 1 project to comunication with usb port in VB.NET.But now,i have code VB6 and then i want to change the code VB6 to VB.NET.[code]....
View 4 Repliesi'm creating a windows form to send/receive data to/from serial port.At first : i send the data as string to the serial port .Second: i tried to read the string again for test the successfull transmission , but i recieved empty string
[Code]...
I am using two serial port in my programm.What is want is, i need to receive data from one port and send on another port and vice a versa.This code receive data from one port but can't receive data from another port. I have tried to simulate this code by using hyper terminal and it works properly with both com port. Where as i have written code in Vb6 too and its is giving same problem as giving interupt while recieved data from one port but not giving interupt which receiving from another port. I know the another way to receive data is by using timer and read data by command as readline(), but what to do to make both the port gives interupt which receive data.Please help to find out the porblem, the code is in Vb.net and it is as under.[code]
View 1 RepliesI am trying to get serial port communication working between two PC's.
My environment is: XP SP3, 9 pin serial ports on both ends, connected by a null modem cable, Visual Basic 2010 Express.
I have a sending routine and a receiving routine, both based on the on line documentation.
There are no Errors, Warnings or messages.
Problem: The receiving machine shows no sign of receiving a message sent by the sending PC. I have tried making the sending PC into the receiving PC - makes no difference.
My sending routine looks like this:
Sub SendSerialData(ByVal SendData As String)
'Send string to serial port
Using com1 As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort("COM1", 9600, Parity.None, 8, StopBits.One)
[Code].....
How do I implement Serial COM Port communication?
View 1 RepliesI am trying to interface an instrument that I send orders to.An order consists of 4 lines which I am to write to the serial port one at a time and receive an ACK before sending the next line.I have interfaced in the past using the MSCOMM, I'm new to the Serial Port class. But even then I've always received data, never sent anything.My question is when I'm looping through my 4 lines of my order, at what point do I receive ACK? Obviously, not in the same function, right? And how do I know I received an ACK and can go on to output the next line?
View 2 RepliesI'm trying to read data coming from a serial port. I simply want to ignore all other data besides the string "button_pushed". The device actually writes "button_pushed" to clean up the display when viewing the serial connection from console or similar. I can change this easily but I'd like to keep it if possible.
My code is as follows:
[Code]...
I'll get an IOException from readLine(). I tried using readExisting() which prevented the error but results in the block being executed twice (probably caused by the "") so the log reads "No data match" and "Data match" for one button push.I have a few questions. First, why does ReadLine cause an exception? I tried to negate that with is_closing but it still occurs. Second, will I run into problems using readExisting as it reads the entire buffer?
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 Repliestell me the settings required for serial port communication
View 1 RepliesI am using two computer to connect to each other via serial port, I have made a program in VB that allows me to read from the serial port then store whatever that character is to a variable. The only problem is I have to hit a button to read in from the serial port and pass the character to the variable. Is there any way to do this automatically?
View 6 RepliesI am trying to create a client server application. I am going to make this simple so that a basic chat application. I have gone through these tutorials:
[Code]...
I have a VB2005 application that sends and recieves data with another application (3rd party, not vb 2005) via COM port. When I run the apps on different computers they work great, they send all data to eachother and everything is fine. When I run them both on the same computer with either virtual null modem ports or with 2 hardware ports connected together via null modem cable they stop communicating.
[Code]....
In my application I am using MSComm32.ocx control for the purpose of serial port communication.
when i am using it I am getting a following error while writing data to the port.
"AxMSComm1.Output {"Exception from HRESULT: 0x800A018A (CTL_E_GETNOTSUPPORTED)"} Object "
I am writing the output to the port like below. AxMSComm1.Output ="Hello"
I mention the properties of the ocx control in the form load like below. AxMSComm1.CommPort = 1
AxMSComm1.Settings ="9600,N,8,1"
AxMSComm1.InputLen = 0
AxMSComm1.PortOpen =True
I searched for this error in the net.But I am not found any information for this issue.
can anybody explain why I am getting that error and how to resolve it???
Do someone know if there is a\\ USB control for the USB port communication? like the SerialPort control for the COM port.
View 2 RepliesI have a VB.net app running on one computer, displaying text into 2 texboxes or labels.I need to see the two values in two sperate textboxes or labels from the two labels on another computer via a null modem serial adapter.
1st computer.
Code:
serialport1.writeline(label1.txt)
straight forward right?
2nd computer to read the data
Code:
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
dim s as new string = serialport1.readline()
label1.text = s
This is what I was thinking;
Code:
serialport.writeline(label1.text & label2.text
This would send the two values over the serial port. How would I seperate the two values and display them in two different texboxes?cannot use them together)Am I on the right path at all? Or using the serialport.writeline method won't work at all....
I am using MSCOMM (mscomm32.ocx) for serial Comm. using VB.NET 2005:
Receiving Error: "AxMSComm1.Output {"Exception from HRESULT: 0x800A018A (CTL_E_GETNOTSUPPORTED)"} Object "
How to resolve this Issue, Below is the code snippet which i am using. [Code]
I have a TCP connection code for client and server communication. It's not meant to be malware but it collects the clients computer information and then connects to the server.
It successfully "connects" but then immediately disconnects.Here is the code for the server:
Dim Listener As TcpListener
Dim Client As TcpClient
Dim ClientList As New List(Of ChatClient)
Dim sReader As StreamReader
[Code]...
I have port forwarding all done and it works if I run the client and server on my own machine. If I run the client on another machine though It gives me a message box saying that it connected with the clients remote IP and at the same time it tells me it disconnected. The client never sends the system information. What is the problem?
I create a UserControl application
So I put in it (put in UserControl) a Button
how to user this userControl in VB6
I've seen this great example of serial communication in VB.NET
[URL]
I try to use it in a project I am working on but somethings are not clear to me.
1: Now the send and received data is shown in one RichTextBox but I would like to split this into two RichTextBoxes (RtbSend and RtbReceived).It is unclear to me how and were data is assigned to the RichTextBox?
2. the received data is shown in the Richtextbox as one long line, I would like to get a new line for every send message.So for example: I I send "test" four times, I would like to see:
Test
Test
Test
Test
now I see: Test Test Test Test I've tried ctrlf but this does not work.The example describes that "comPort_DataReceived" is executed when data is waiting in the buffer. Where can I see the eventhandler responsible for this? How does it know data is waiting?The problem is this kind of coding is a bit to difficult for me. I want to understand the code before I implement it into my project.
I have some issue can't control combobox on external application since used .Net Application
View 4 RepliesI have 2 projects
UI
Functionality
UI references Functionality to call specific functions. Functionality needs to call certain functions that operate UI. This is what I mean by Duplex communication. Is there any way to do this without causing circular dependency?Should there be 1 main project which simply does all the calling acting as a "wrapper" between UI and Functionality?
What do I want to achieve: I want to perform some time consuming operations from my MDI winforms application (C# - .NET). An MDI child form may create the thread with the operation, which may take long time (from 0.1 seconds, to even half hour) to complete. In the meantime I want the UI to respond to user actions, including manipulation of data in some other MDI child form. When the operation completes, the thread should notify the MDI child that the calculations are done,so that the MDI child can perform the post-processing.Should I use explicit threading (i.e., create explicit threads), thread pools? Or simply just propose your solution. Should I create foreground or background threads?And how does the thread communicates with the GUI, according the solution you propose?
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
actually this is not an vb.net code belongs to vb..i have written it for getting the data from com port 1.but i dont know what data the com port is getting..
Dim Lng As Long
Dim lpPoint As POINTAPI
Dim X, Y As Long
[code].....
I made serial COM1 work by default settings in serial port properties. If I want to change to another port,e.g. COM2 as well as change other settings (baud rate, data its, etc.), how to re-open this new port?
View 2 RepliesWhat i want it to do is 'listen' to the lpt port, when a sensor is broken then display the time. there are two sensor to measure the time of the first and then the second sensor.How do i get VB to listen to the sensors which are on two different inputs of the lpt port and time stamp in micro seconds. I can get it to read the state of the input on mouse click but i need it to display the time in micro seconds when the input changes. i will then use the times from the two sensors to work out the time it took between both sensor changing.
View 5 RepliesOn VB6 when tring to select True value in the RightToLeft property it return to be false.I'm running the vb6 on windows 7 machine.
View 2 RepliesPublic Class my_class Dim WithEvents COMPort As New System.IO.Ports.SerialPort
Public Sub FindReader()
Dim ports As String() = IO.Ports.SerialPort.GetPortNames()
Dim port As String
For Each port In ports
[Code3]...
When it runs, it shows a single COM port "COM1". I am assured that the device attached to it is a standard 8,n,1 and uses 9,600 baud. The exception is "Acess to the port 'COM1' is denied".
I write a code that can detect com port, like this
CODE:
I'm getting familiar now with using the Dataset Designer and how it makes for quick and easy updates and query of tables. I use to use the OleDB commands and leave the Connection String as a Global Constant so I can easily change it if the server name changes, or if we have to re-direct the .NET to another instance of the database.
But now that I use the Dataset designer I'm concerned that I maintain flexibility and support in the long run. how the Dataset designer works and where it stores it's connection string info? And how difficult that would be to update. It looks like I modify the App.config file, but I'm unfamiliar with this.
What am I getting myself into? It looks like a standard XML file. Is that it?