Re: Help speed up RS-232 communications!




"John McMurdy" <john.mcmurdy@xxxxxxxxx> wrote in message
news:gm777t$ij3$1@xxxxxxxxxxxxxxxxxxxxx
I am struggling to get my data transfer rate where i need it for a RS-232
communication to a custom PCB. When i communicate with the device using
hyperterminal, it is almost instantaneously, indicating it is not the
RS-232 speed or processor speed. Simply, i send an RS-232 command, and then
tell the system to read what comes back with the fread command. It is just
a stream of characters that correspond to hex values on an image sensor.

fwrite(serobjw, uint8([ 'S', 13]),'uint8');
S = char(fread(serobjw))';

I set the connection settings such that the input buffer is not
significantly more than the amount of data i expect to receive, so i
wouldn't think that would be the cause of the delay

serobjw.Baudrate = 115200; % Set the baud rate at the specific value
set(serobjw, 'Parity', 'none') ; % Set parity as none
set(serobjw, 'Databits', 8) ; % set the number of data bits
set(serobjw, 'StopBits', 1) ; % set number of stop bits as 1
set(serobjw, 'Terminator', 'CR/LF') ; % set the terminator value to
newline
set(serobjw, 'InputBufferSize', 3500) ; % Buffer for read operation,
set(serobjw, 'OutputBufferSize', 512) ;% Buffer for write operation,
get(serobjw) ;
fopen(serobjw) ;
get(serobjw, 'Status') % Gets the status of connection if 'open'
connection was established
get(serobjw, 'InputBufferSize')

Any suggestions on how to speed this guy up and how troubleshoot where the
delay is coming from would be extremely helpful.



Hi John,

If you know the size of the response, specifying the size of the read may
speed up your serial/FREAD call.

S = char(fread(serobjw, serobjw.BytesAvailable))'; % This presumes all
bytes have been sent by the external device.




.



Relevant Pages

  • Re: Confused about synchronous communications
    ... For your i2c communication it seems like you don't you any interrupts or ... If the communication is interrupted by a task switch, ... 'polling' does not apply here, as you can change the clock, and then ... The routines have a delay that you can set, ...
    (sci.electronics.design)
  • Re: Access STIMER(M) from COBOL program?
    ... This function (and CEEDLYM for delay in milliseconds) are available ... message is not the intended recipient or an authorized representative of the ... communication is strictly prohibited. ... attachments from your system. ...
    (bit.listserv.ibm-main)
  • Re: once upon a time... : linked tables
    ... once upon a time I read that the communication with the back end ... If you keep a persistent connection then that delay happens only once. ... You don't really have to create a "useless table" to do this though. ...
    (comp.databases.ms-access)
  • XP Pro and NT 4.0 Server
    ... I am having an issue of a delay in my XP clients ... connecting with NT 4.0 Server ... the process over and minimize the app. ... Seems like there is some communication issues between XP ...
    (microsoft.public.windowsxp.network_web)

Loading