loading
 
serial problem
Roland from South Africa  [107 posts]
11 year

I'm still battling with getting things sent reliably using the serial module.

I have a script to set a variable for three passes, then reset it, as a send strobe pulse. Problem is, it's not always sent out.
Lets say it's "S" for strobe,  and "n" for the reset condition. The machine runs at 5 - 15 FPS

The serial port is also receiving. Let's say it's getting <cr>12

If I set the send rate to 100ms, and send a Strobe, I see something like;
<cr>12
n
<cr>12
<cr>12
R
<cr>12
n
n
<cr>12
<cr>12

where the R is not always sent. Sometimes I see two R's sent.
However, if I set it to AFAP, which it I presume is a 'process it per pass' I would expect to see;
n
<cr>12
R
<cr>12
R
<cr>12
R
<cr>12
n
<cr>12
n
<cr>12

where R gets sent on three passes because it's processing on in and out on every pass.
However, what happens instead,  is you see;
<cr>12
<cr>12
<cr>12
<cr>12
<cr>12
<cr>12
nnnnnnnnnRRRnnnnnnnnnnn
<cr>12
<cr>12
<cr>12
<cr>12
<cr>12
<cr>12

So one can see that the send stuff is being buffered until it's about to ovverun, and then send as a block. I can watch the delay on my LED's. It's not the display that's buffering, there is a real delay before the S gets sent. It's very late.

How do I set the serial module to actually send R R R, one for each pass, as one might expect?
Serial is 9600, 8,N,1

Regards
Roland



Anonymous 11 year
Just for completeness, this has been addressed with the addition of a 'wait for reply' checkbox in the serial module. Normally the serial module operates asynchronously to avoid delaying the pipeline .. but sometimes it is needed to wait for a reply. This WILL slow down the pipeline esp at a slow baud rate.

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index