hi
i have a problem
i am writing a code in C#
i wanna receive a byte from serial port
but when i wanna receive data from port that sounds my program is hang
and doesnt work any more
SerialPort port = new SerialPort("COM3");
port.Open();
byte[] b = new byte[10];
port.Read(b, 0, 1);
port.Close();
please help me
...
I understand from the MSDN docs that the event DataReceived will not necessarily fire once per byte.
But does anyone know what exactly is the mechanism that causes the event to fire?
Does the receipt of each byte restart a timer that has to reach, say 10 ms between bytes, before the event fires?
I ask because I'm trying to write a...
Occasionally we get this error when communicating between my motion control software and a plasma cutting torch. What the serial link is being used for is a one time setup of cutting information before the cutting begins. I am using VB6 and MSComm for this.
I know the port itself has lunched because after it occurs other serial comm sof...
Here is a copy of the datasheet from a microcontroller:
Break characters are a full character
time of logic 0 (including a 0 where
the stop bit would be normally).
This is what I want to generate with the windows COM port (Windows SDK). The problem is I don't see a way to have the stop-bit set to zero. Any ideas?`
SetCommBreak...
I have a piece of code that can read current state of serial port CTS line, and application then goes into appropriate mode bases on value there.
Using null-modem cable described here:
http://www.lammertbies.nl/comm/info/RS-232_null_modem.html#full
i can detect RTS line on some other port that is connected via that null-modem cable.
...
A contract programmer is building a simple application for me to automate the process of pairing a Bluetooth SPP device with a PC; we can do this with the standard Microsoft Bluetooth GUI, in which case, the result is both an incoming and outgoing port. The purpose of the project is to simplify this process for the ultimate user.
The pr...
I have a problem with ReadFile function in a virtual serial port:
char tmp[128];
int multiplo=0;
DWORD err;
COMSTAT stt;
ClearCommError(hcom, &err, &stt);
do{
if(ReadFile(hcom, tmp, stt.cbInQue, &err, NULL)){
tmp[err] = '\0';
memcpy(bfIn+multiplo, tmp, err);
multiplo = multiplo + err;
}else
retur...
I made an application in C# which sends 11 byte of data to a serial port using:
port = new SerialPort("COM1");
port.BaudRate = 9600;
port.DataBits = 8;
port.Parity = Parity.None;
port.StopBits = StopBits.One;
port.ReadTimeout = 1000;
port.WriteTimeout = ...
Hi all,
I need to read the serial port from windows, using either Python or C++. What API/Library should I use? Can you direct me to a tutorial? Thanks!
...
I'm dealing with a gm29 by Sony Ericsson.
The datasheet says that plugging the power is not sufficient to switch on the modem. It says:
activate the RS232 control line DTR, high for > 0.2s.
I'm writing some tests in python, but:
#!/usr/bin/env python ...
I need to measure the time between character events on a serial port, preferably under Windows 7.
I have read in various places, statements like "Windows will not provide greater resolution than 10ms", but I have not been able to find out what that really means.
Is the problem that the OS will not deliver the events with greater accuracy...
Hi
I have an application where I am sending data via serial port from PC1 (Java App) and reading that data in PC2 (C++ App). The problem that I am facing is that my PC2 (C++ App) is not able to read complete data sent by PC1 i.e. from my PC1 I am sending 190 bytes but PC2 is able to read close to 140 bytes though I am trying to read in ...
Hi
Not sure how to handle SerialPort DataReceived.
Scenario
I have an application that communicate with a device and this device returns a status .This happens in different stages EG
public enum ActionState
{
Started,
InProgress,
Completed
etc...
}
Now if I were to use the DataReceivedEventHandler how can I tell what Method is e...
Hi
I am trying to send text data from one PC to other using Serial cable. One of the PC is running linux and I am sending data from it using write(2) system call. The log size is approx 65K bytes but the write(2) system call returns some 4K bytes (i.e. this much amount of data is getting transferred). I tried breaking the data in chunks...
I am trying to send a ctrl-x keystroke to COM2 and I ahve to code to open the port and read and write but when I tried to send Chr(Keys.ControlKey + Keys.X) it did not work. any ideas?
...
Is it possible to set one pin of the serial port continuously high using python (or C)?
If yes, how?
...
Okay, when I establish a connection using LabVIEW or Python to my Arduino Duemilanove (ATMega328) either my Bluetooth or keyboard is killed. I am simply trying to establish a connection to /dev/cu.usbserial-A9007UZh (or tty.usbserial-A9007UZh, but that seems to kill the keyboard or bluetooth even after Terminal is shut down when using p...
Hello.
I'm facing a particular issue that regards serial communication under win32.
I'm communicating with a device can only accept frames when it is not already communicating. So I must find a valid frame and then inmediatelly send my request.
I developed a class named Serial that handles basic operations on serial port (open, close, r...
This seems like a simple question, but it is difficult to search for. I need to interface with a device over the serial port. In the event my program (or another) does not finish writing a command to the device, how do I ensure the next run of the program can successfully send a command?
Example:
The foo program runs and begins writin...
Hi!
Previously I defined com-port number using DBT_DEVICEARRIVAL:
procedure TMainForm.WMDEVICECHANGE(var Msg: TWMDeviceChange);
var
lpdb : PDevBroadcastHdr;
lpdbpr: PDevBroadCastPort;
S: AnsiString;
begin
{Заголовок сообщения}
lpdb := PDevBroadcastHdr(Msg.dwData);
case Msg.Event of
DBT_DEVICEARRIVAL:
begin {Добавление}
if l...