From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLYTO_END_DIGIT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,350aad0f4c973ca7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-11 17:36:43 PST From: Patrick Hohmeyer Subject: Re: Timeout or agreement Newsgroups: comp.lang.ada Reply-To: pi3_1415926536@yahoo.ca References: User-Agent: KNode/0.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-ID: Date: Mon, 11 Mar 2002 20:38:45 -0500 NNTP-Posting-Host: 65.94.189.103 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1015896950 65.94.189.103 (Mon, 11 Mar 2002 20:35:50 EST) NNTP-Posting-Date: Mon, 11 Mar 2002 20:35:50 EST Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!tor-nx1.netcom.ca!news1.tor.metronet.ca!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:21092 Date: 2002-03-11T20:38:45-05:00 List-Id: And Meresup wrote : > My problem is to wait for the agreement of a sub routine or raise an > response_error exception on timeout. It's so easy to do it with logical > programming that I don't see the way to do it in a sequential programm. > Can u help? > > Explanation : > I send a data to serial port > I'd like to wait for the OK flag of the called procedure or a timeout. > What could be the correct structure???????? TASK, what you need is a task. To do what you want you need a second thread or process (always). Your logical language seems to encapsulate the thread creation for you, in Ada you need to define a task or a task type. This is a rather complicated matter, so search yourself a book / online tutorial about it. Another word : As you probably want to stop the thread waiting on the serial port, you may run into problems. Stopping a task in the middle of it's execution can leave the system in an inconsistent state, so be sure to find a *very* *good* exemple befor doing it. Have fun ;-) -- Patrick Hohmeyer