serial-port

serialport exception java

hi, i'm reading data from serialport using javax.comm API but when i run the code 2-3 times it is showing port currently own by this,but i have closed the port what's the problem i'm not getting plz help me this is expetion: javax.comm.PortInUseException: Port currently owned by flashhandler.TwoWaySerialComm Thanks for reply ...

Serial Port Cable Unplugged

In .Net's SerialPort object, is there a way to determine if a serial port gets unplugged or plugged in. ...

how to write a virtual com port to TCP driver?

Hi I am trying to write a windows virtual com port driver which will divert the data to a IP address. any pointers, best practice will be of help? ...

Deadlock when closing thread

I created a class that opens a COM port and handles overlapped read and write operations. It contains two independent threads - one that reads and one that writes data. Both of them call OnXXX procedures (eg OnRead or OnWrite) notifying about finished read or write operation. The following is a short example of the idea how the threads...

Sending data through a serial port

am doing some surveillance project... i need to make some serialport data communication between two systems ... here i could find available com ports in my system through which i need to send and receive some data...is it possible in .net framework 1.1 ? is there is any option? System.IO.Ports is not available .net 1.1 ...

pyserial - How to Read Last Line Sent from Serial Device

So I have an Arduino connected to my Windows XP computer. It's just running a loop, sending a value over the serial port back to the computer every 100ms. I want to make a Python script that will read from the serial port only every few seconds, so I want it to just see the last thing sent from the Arduino. How do you do this in Pys...

Issues writing to serial port on MAC OSX using unistd.h in c

I am trying to write to a bluetooth device on MAC OSX using the unistd.h Linux functions in c. I am connecting fine and writing the first few bytes with success. When I try to write other commands to it (there are bytes added to the write buffer every 15ms), I don't see any results even though the write() function returns 1 (write succes...

Can't receive serial data in .net 2.0, using rs232 to rs485 converter

I've done a good deal of RS232 work using the .Net 2.0 serialport class. I've never had trouble with it, until today. I'm communicating with a piece of company hardware that uses the RS485 protocol. I'm using an RS232 to RS485 converter device from B & B electronics. I can send data just fine, and see it received on the other side. ...

Using open2300 with Ubuntu

Hello, I am currently running Ubuntu 8.10 and have been trying to use Open2300 to read data from a Lacrosse WS-2310 weather station and report it to the WUnderground server. The program compiles fine but when I try to run it, it does one of two things: usually it pauses for about 4 minutes, then prints "could not reset" to the screen. ...

Overlapped serial port and Blue Screen of Death...

I created a class that handles serial port asynchronously. I use it to communicate with a modem. I have no idea why, but sometimes, when I close my application, I get the Blue Screen and my computer restarts. I logged my code step by step, but when the BSOD appeared, and my computer restarted, the file into which I was logging data conta...

Forcing termination of BeginWrite in a Serial COM port IO app using BaseStream

I have a C# program that communicates with serial devices using the built in SeralPort class. However, I want to do asynchronous writes and for that I am using BaseStream.BeginWrite(). In the async callback I call BaseStream.EndWrite(). All this works fine. However, on occasion I want to close a port BEFORE the BeginWrite() has finished ...

Linux termios VTIME not working?

We've been bashing our heads off of this one all morning. We've got some serial lines setup between an embedded linux device and an Ubuntu box. Our reads are getting screwed up because our code usually returns two (sometimes more, sometimes exactly one) message reads instead of one message read per actual message sent. Here is the code ...

C# Serial Wedge

C#, WinForms, .Net 2.0 I'd like to create my own software serial wedge in C#. I have all the code for the serial I/O, and can get the data converted from Hex to ASCII and into a database or listbox. But am unsure how to translate the data into key presses that will go into the active application. Can someone direct me to an article o...

How to get information passing through COM ports on Windows?

I'm programming a solution that requires parsing some data sent to a printer that is attached to a serial port. It's only reading, I don't need to interfere with the communication, but I need it to happen real time... I've searched around and found nothing that allows me to do this kind of stuff using the language i'm programming the so...

How to programatically find all available Baudrates in C# (serialPort class)

Hi! Is there a way to find out all the available baud rates that a particular system supports via C#? This is available through Device Manager-->Ports but I want to list these programatically. Thanks. ...

DCB structure help

I have some questions about the DCB structure that’s used in Windows to control serial communication. How should the EofChar and EvtChar fields be used? Is having fParity set to true and fErrorChar set to false the same as fParity set to true and fAbortOnError set to true? ...

Resetting comm event mask

Hi. I have been doing overlapped serial port communication in Delphi lately and there is one problem I'm not sure how to solve. I communicate with a modem. I write a request frame (an AT command) to the modem's COM port and then wait for the modem to respond. The event mask of the port is set to EV_RXCHAR, so when I write a request, I...

C#: SerialPort communication

I wish to write to the serialport com1 01 00 00 02 37 30 04 That's the command for initialization.. When i write a char array or byte array c[0] = (char)01;// c[1] = (char)00; c[2] = (char)00; c[3] = (char)02; c[4] = (char)37; c[5] = (char)30; c[6] = (char)04; serialPort 1.Write(c, 0, c.Length); byte[] bb1 = System.Text....

Information about SCO Unix Com ports

I am trying to talk to a SCO Unix box through the Serial Port where there an existing application. I need to figure out what parameters the application set the serial port too. This is an older non-GUI version of Unix so I need to be able to do this from the command line. I know it involves using /dev/tty* however I am having difficul...

C#: serialport1.read not working..

Serialport class read methods waits indefinitely... I am able to open send init hex code... but unable to read .... ...