Thread Subject: Serial Port Issue - Buffer flush?

Subject: Serial Port Issue - Buffer flush?

From: ecnyx

Date: 7 Aug, 2008 23:17:16

Message: 1 of 1

Hi All,

I have been struggling with communicating through serial port for
several days. Bottom line is I am unable to recieve data from my
hardware. I am using PortMon to monitor the communication lines. I
know the hardware works because it runs with the software that came
with it. The following is a log of one of my commands:

......
IRP_MJ_WRITE Length 11: 0A 04 00 00 00 00 00
00 00 04 00
IOCTL_SERIAL_SET_WAIT_MASK Mask: TXEMPTY CTS DSR RLSD BRK ERR RING
IRP_MJ_FLUSH_BUFFERS
IOCTL_SERIAL_SET_WAIT_MASK Mask: TXEMPTY CTS DSR RLSD BRK ERR RING
IOCTL_SERIAL_GET_COMMSTATUS InQueue: 0 OutQueue: 0
IOCTL_SERIAL_GET_COMMSTATUS InQueue: 0 OutQueue: 0
IOCTL_SERIAL_GET_COMMSTATUS InQueue: 0 OutQueue: 0
IOCTL_SERIAL_GET_COMMSTATUS InQueue: 0 OutQueue: 0
IOCTL_SERIAL_SET_WAIT_MASK Mask: CTS DSR RLSD BRK ERR RING
IOCTL_SERIAL_GET_COMMSTATUS InQueue: 0 OutQueue: 0
IOCTL_SERIAL_GET_COMMSTATUS InQueue: 0 OutQueue: 0
IOCTL_SERIAL_GET_COMMSTATUS InQueue: 0 OutQueue: 0
.......

Somehow, Matlab keeps flushing the buffer of the device. I use
fwrite.

My settings are:
Baud: 19200
Stopbit: 1
Parity: none
DataBits = 8
RTS = off
DTR = off

Can anyone shed light on this please?

Thanks!

Ellen

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com