Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #24359

Re: ASCII Protocol implementations in FORTH

From stephenXXX@mpeforth.com (Stephen Pelc)
Newsgroups comp.lang.forth
Subject Re: ASCII Protocol implementations in FORTH
Organization MPE
Message-ID <51dd4ae2.164202705@news.demon.co.uk> (permalink)
References <9ed50be0-eda5-4513-b5e2-47eeac561c88@googlegroups.com>
Date 2013-07-10 11:58 +0000

Show all headers | View raw


On Tue, 9 Jul 2013 07:19:17 -0700 (PDT), attoampere@gmail.com wrote:

>the whole complexitiy of the error detection mechanism is basically this:
>
>*)
>Scenario 1.
> 1 The computer sends a command block stamped with sequence #1 to the
>pump.
> 2 The pump receives the command, sends an acknowledgement to the PC, and
>executes it.
> 3 Transmission of the acknowledgement message is imperfect; the PC does no=
>t
>receive it.
> 4 The PC waits 100 ms for the acknowledgement, then retransmits the
>command block with the sequence number left at 1 and the repeat bit set to
>indicate a retransmission.

...

The essence of this problem is that you
1) need to send and receive characters on a serial line. 
2) need to wait for a number of milliseconds.

Most modern Forths, either desktop or embedded, have a way to redirect
I/O through KEY? KEY EMIT and TYPE. All the needed tools are in the
MPE VFX desktop Forths and in the MPE cross compilers.

The standard word for waiting is MS ( ms -- ).

You can write and test the program logic by runnng the program at a
PC keyboard. Then you need to work out (read the documentation) how
to redirect input and output to a serial line.

Personally, I would probably put the comms actions in a separate task
so that I could log results to the system console.

Stephen

-- 
Stephen Pelc, stephenXXX@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ASCII Protocol implementations in FORTH attoampere@gmail.com - 2013-07-09 07:19 -0700
  Re: ASCII Protocol implementations in FORTH "Paul E. Bennett" <Paul_E.Bennett@topmail.co.uk> - 2013-07-09 21:33 +0100
    CRC was Re: ASCII Protocol implementations in FORTH all2001@spambog.com (Wolfgang Allinger) - 2013-07-09 19:30 -0400
  Re: ASCII Protocol implementations in FORTH "Elizabeth D. Rather" <erather@forth.com> - 2013-07-09 12:05 -1000
  Re: ASCII Protocol implementations in FORTH Paul Rubin <no.email@nospam.invalid> - 2013-07-09 17:59 -0700
    Re: ASCII Protocol implementations in FORTH Paul Rubin <no.email@nospam.invalid> - 2013-07-09 21:03 -0700
      Re: ASCII Protocol implementations in FORTH "Elizabeth D. Rather" <erather@forth.com> - 2013-07-09 17:47 -1000
        Re: ASCII Protocol implementations in FORTH Paul Rubin <no.email@nospam.invalid> - 2013-07-10 00:09 -0700
          Re: ASCII Protocol implementations in FORTH Mark Wills <markrobertwills@yahoo.co.uk> - 2013-07-10 01:57 -0700
            Re: ASCII Protocol implementations in FORTH albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-10 12:00 +0000
          Re: ASCII Protocol implementations in FORTH "Elizabeth D. Rather" <erather@forth.com> - 2013-07-10 07:47 -1000
  Re: ASCII Protocol implementations in FORTH attoampere@gmail.com - 2013-07-10 03:22 -0700
    Re: ASCII Protocol implementations in FORTH Paul Rubin <no.email@nospam.invalid> - 2013-07-11 07:26 -0700
    Re: ASCII Protocol implementations in FORTH Elizabeth D Rather <erather@forth.com> - 2013-07-14 18:53 -1000
  Re: ASCII Protocol implementations in FORTH stephenXXX@mpeforth.com (Stephen Pelc) - 2013-07-10 11:58 +0000
    Re: ASCII Protocol implementations in FORTH "Elizabeth D. Rather" <erather@forth.com> - 2013-07-10 07:55 -1000
  Re: ASCII Protocol implementations in FORTH rickman <gnuarm@gmail.com> - 2013-07-14 23:30 -0400

csiph-web