Check On Serial Ports Is "breaking" USB Modem?
May 31, 2011
I am using the following code to enumerate through com ports to determine if the attached modems are in use.When I get to my usb modem, it returns the correct "PostIsAvailable" status, but then it kind of locks up the modem and I get the following error when I try to manually query the modem I get: "The modem failed to respond. Make sure it is properly connected and turned on. If it is an internal modem, or is connected, verify that the interupt for the port is properly set."I either have to manually requery the modem or unplug/plug it again.This code works fine on my external serial modem, but not the USB modem.
Public Function PortIsAvailable(ByVal port As String) As Boolean
Dim TempPort As New SerialPort
TempPort.PortName = port [code]......
View 5 Replies
ADVERTISEMENT
Feb 19, 2009
What is the best way of communicating with Serial ports and TCP/IP communcation using vb.net?Using visual studio .net can we make it easier?? Can anyone send me sample application of communications?If I write a program communicating with my hardware using Searial port or TCP/IP, will the program be slow?? Are there any programming techniques working with communication ports?
View 1 Replies
Dec 20, 2010
is there any other way to access a serial port using visual basic.net 2010? i followed the steps in this site, How to access serial and parallel ports by using Visual Basic .NET but i just got this output Open the serial port. Send the attention command to the modem. Wait for data to come back to the serial port...
[Code]...
View 2 Replies
Jun 6, 2011
I'm fairly new to Visual Basic (VB), but I've already got running code to access all my serial port. The problem is I want to load multiple serial ports into an array and loop through them in my functions. The program allows me to create ports(), but fails when I try to populate it.
Dim ports As IO.Ports.SerialPorts()
ports(0) = SerialPort1
Where SerialPort1 is an object I draged from the Visual Studio toolbox.
View 2 Replies
Apr 24, 2010
I'm learning the serial port programming. So, I study the code samples from MSDN - VB101SamplesBCL2 http:[url].....While ran the solution of "UsingTheSerialPort", It shows error: It highlights one sentence textBox2.Text = SerialPort1.ReadLine() -- Line 40 ,and says :
"InvalidOperationException was unhandled - Cross-thread operation not valid: Control 'textBox2' accessed from a thread other than the thread it was created on."
View 1 Replies
Oct 26, 2011
The 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
View 8 Replies
Apr 20, 2009
able to open and utilize a single serial port within with my VB 2008 program (i.e., set port parameters, open&close port, send&receive data via port, etc.), but I want to open two or more serial ports concurrently within my VB 2008 program so that I can read data from one port, say COM1, make decisions and calculations based on that data, and send instructions out through another port, say COM2.
View 1 Replies
Aug 8, 2009
I am still new in programming. I am an electrical engineer. I have to read the time from GPS from one serial port apend this time to a data got from other device serially.
View 1 Replies
Aug 24, 2010
I am creating an application to configure some modems through the serial port. I have no problem sending a single string of data to the serial port and displaying the immediate response to a rich text box. I have 2 problems
1st: how to update the rich text box for any delayed response from the modem
2nd: how to react to the response from the modem, in other words I want to send the next command based on the response from the modem witch is usually "OK"
This is what my code looks like currently to send ans receive data from the serial port. (sport1 is my serial port and display is my rich text box)
sPort1.Write("AT+WOPEN=1" + Environment.NewLine)
With Display
.AppendText(sPort1.ReadExisting())
[Code].....
View 1 Replies
Dec 17, 2010
I want to know if there is a way to refresh a combo box when a new serial port becomes available.[code]
View 2 Replies
Mar 6, 2009
I have spend about a week trying to get data from this radio set through a modem and a serial port. The data is transmitted by the transmitter in 5-databits at baud rate of 50. An existing vb 6.0 program in windows 98 receives the data correctly with port settings of Speed = 50, Databit = 5, Parity = none and Stop bit = one. The data is received at every 9 sec, presumably with the help of a timer. I have to write a program in .net frame work 2.0 to get the same data. My problems are:
1. The program hangs when I execute SerialPort1. ReadLine().Trim or SerialPort1.ReadExisting
2. When I collect SerialPort buffer after every 9Sec, and try to get the strings out of each byte using following code, I get only repeated squares instead of characters.
[Code]....
View 5 Replies
Jul 22, 2009
I'm wondering how I could monitor a serial port for a voltage change or contact closure and have an event triggered when there is a detection.
View 1 Replies
Sep 4, 2009
I 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....
View 4 Replies
Sep 7, 2009
I'm reasonably proficient with VB but never had any expirence with communicating with hardware. I have a piece of software that communicates with a Eurotherm 3216 process controller via RS232, but its use is fairly restricted what it can do.What I want to be able to do is take the communication from the software and redistribute it to THREE Eurotherm 3216 controllers, so my software would intercept the comms and effectively emulate the Eurotherm.
View 5 Replies
Jun 29, 2009
I have the following code to create an array of serial ports.
[Code]...
View 5 Replies
Sep 17, 2009
I am wondering is there any code to get the text reply from the modem? I am using the itegno W3800 modem. I have used the below method so far but apparently VB.NET windows form doesnt see the incoming data. The message box comes out empty. But when i try the same method with the TMAS Siemens GSM modem, VB.NET can see the incoming data and display out the data string.
here is the code that i have written:
serialPort.Write("AT" & vbCrLf) 'set command message format to text mode(1)
receiveddata = serialPort.ReadExisting()
it works for the TMAS gsm modem.
The baud rate for the TMAS GSM modem is 9600 and the baud rate for the itegno modem is 115200.
For the itegno modem, the data is sort of like stuck at the serial port as after every time i pressed on the button for example "AT"
this "AT" command gets "stuck" at the serialport and run only when i have connected through the serial port in hyper terminal.
I am thinking is it the baud rate for 115200 is too fast for VB to handle? And also is there any way to solve this problem?
i have to revert back to the itegno modem for use for my project at the end of the day.
View 2 Replies
Jul 29, 2009
i saw Anti virus auto run when usb enable but i don't how to check port usb? my idea.i want to run my program when have port usb open
View 8 Replies
Mar 9, 2010
I have created a program using FaxServer and FaxDocument. I want to know if there is a way to determine programically if the modem is busy? Busy in terms of it could be sending/receiving a fax or another program is using it. I just need to know if its in use.
View 5 Replies
Mar 22, 2010
I am trying to determine if a modem is busy. I have tried using serial ports which from what i can see just tells me that something is tied to a port or not. It does not tell me if the modem is busy.
My overall question is How do can I determine if a modem is busy? For an added bonus, also is there a way to tell what device is using a particullar port?
View 1 Replies
May 20, 2012
Check listening ports on remote machine
View 1 Replies
Feb 20, 2011
what is wrong with my code and I get no feedback from my button click event, i have imported. ( code Below) and i have tied differrent combinations of the code without sucess.maybe add extra to my code for the list to show open Port or closed ports.
Imports System.Management
Imports System.Management.ManagementObjectSearcher
Imports System.Management.ManagementNamedValueCollection[code].....
View 9 Replies
Nov 12, 2009
In my project I'm trying to get the caption property of serial ports available on computer. But when I run this code below I get "A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll" exception. I tried putting "Option Strict On" and then I'm getting build error saying it disallows Late binding.
[Code]...
View 5 Replies
Oct 12, 2011
I am attempting to call a remote modem using a local modem connected via USB. Programming language is VB.NET and I am using the SerialPort control to talk to the modem.
Communication is as follows:
I send: ATZ0[CR]
Modem responds: ATZ0[CR][CR][LF]OK[CR][LF]
I then try to dial a number:
I send: ATDTnnnnnnnnnn[CR] where nnnnnnnnnn is a valid number
The modem responds with:ATDTnnnnnnnnnn[CR][CR][LF]ERROR[CR][LF]
All other commands seem to work without any issues
For info the modem is a MultiTech MT5634ZBA-USB-V92
If I use hyperterminal and type the same commands in it works as expected and dials the number, so it must be something I am doing in my code, possible some setup in the SerialPort control
View 5 Replies
Oct 23, 2010
i am using the below code in VB.Net to load the available serial ports :
COMsComboBox.Items.Clear()
Dim i As Integer
For i = 1 To My.Computer.Ports.SerialPortNames.Count
COMsComboBox.Items.Add(My.Computer.Ports.SerialPor tNames(i - 1))
Next
i also want to load their names as seen in the "device manager",
View 1 Replies
Oct 27, 2009
(from scratch as I've not done this before) how I can stream live through modem-to-modem connection. The modem here refers to dial-up modem (PSTN modem), there is no internet/lan involved.It will be 2 programs, the first is to transmit real-time video from webcam, and the second is to remote video from the first.
View 5 Replies
Jan 8, 2011
I am very new to this but i have with alote of help maked a program that comunicates with a relay board over rs232.
[code]...
View 2 Replies
Feb 9, 2010
I'd like to check to see if a serial port even exists. I know that if it doesn't, there is an error thrown when you do a port.open So, I would imagine that doing a simple IF port.isopen won't work?I looked at all the methods on the class and don't see anything obvious on how to do it.I just want to see if the hardware exists on the PC and set a boolean variable if it does when the form loads.
View 3 Replies
Dec 20, 2009
What I am doing is creating an app to send and receive CNC programs to machine tools via the RS232 interface. At the moment I am testing the software with 2 laptops linked together through a cable I have made up. which all works. I have added a serial port to my form 1 and using the code below I can send and receive data. However with the send button I can open the comm port send the data and then close the comm port (No Problems there). With the receive button I want to open the comm port receive the data and close the comm port. The problem I have is checking when the app has finished receiving data so I can then close the comm port
Private Sub Btn_Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Send.Click
Try
[Code]....
View 2 Replies
Oct 2, 2009
I am trying to write something through serial port to my device. Before that, I added the data received handler to read the data when the device response with some data. The problem now is how can i check the status of the data received event? I need to know when the data received event has started or has ended before I can proceed to do some other task like check if the result is successfully receive.
View 2 Replies
Oct 20, 2011
I have an old ClickOnce program, which has been replaced by a new one I wrote, and I am aware that some people are still using the old one.I want to somehow remotely remove it from every computer where it is still being used (there are far too many to manually find them).
View 2 Replies