Com Port Data Errors

Sarah Reichelt sarah.reichelt at gmail.com
Wed Dec 14 22:42:48 EST 2005


> Everything is the same ,hardware and comm settings.
> The command sent does not really matter ,
> for example i used "AT00" which returns ERROR then CR AND LF and then the
> character >
>
> This is the correct response but i can't seem to get Rev to send , receive
> and wait for the > character then repeat without it getting missed sends.
>
> if i put a delay before resending of >= 1 second it works fine.(It should be
> able to repeat in around 100ms , command send,receive and wait for >)
> I may be missing something but what would be the fastest solution
>

What sequence are you following?
I would send then keep reading the serial port and send again as soon
as I had received the >
That way you are not making any assumptions about the send of
transmission or the response time of a particular modem.

Here is what I tested: I sent the first "AT00" and set gIndex to 0.
Then the handler that reads the data called this routine every time it
received anything.

on checkData pRec
    global gIndex
    if pRec contains "ERROR" then
        add 1 to gIndex
        if gIndex < 10 then
            put the label of btn "Port" into thePort
            write "AT0" & gIndex & numToChar(13) to driver thePort
        end if
    end if
end checkData

I don't get your ">" so I used ERROR as the trigger. This loops
through 10 times sending "AT00", "AT01" etc etc. It doesn't miss any
of them and the whole thing takes about 100 ticks, for 10 writes &
reads.

HTH,
Sarah



More information about the use-livecode mailing list