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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,52f068e6dc147923 X-Google-Attributes: gid103376,public From: "news.oxy.com" Subject: Re: Win NT + Object Ada: serial port I/O Date: 1999/02/03 Message-ID: <799g51$p0p$1@remarQ.com>#1/1 X-Deja-AN: 440161131 References: <79952r$2t$1@nnrp1.dejanews.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: newsabuse@remarQ.com X-Trace: 918045665 HXI3FRZSOA57FC7F8C usenet78.supernews.com Organization: Posted via RemarQ, http://www.remarQ.com - Discussions start here! Newsgroups: comp.lang.ada Date: 1999-02-03T00:00:00+00:00 List-Id: lynch@cci.de wrote in message <79952r$2t$1@nnrp1.dejanews.com>... >Hi, > >I have been asked to write a DLL which will be used to talk to a display (LCD) >connected via an RS-485 serial line (DIN 66 019 protocol). The card apparently >comes with a driver which makes it act like a standard COM-Port. Almost all Communication boards come with a driver that act like a standard COM-Port. One of the examples in industry is multiport DigiBoard product line. >2) Use the Win32Ada binding with CreateFile, SetCommTimeouts etc. however the > help file provided with Object Ada is utterly useless. I have yet to find >the section which "describes [...] the transformation rules (from C to Ada)" >Also the guy who will be using this DLL is worried about all the type >conversions etc. ("why use an Ada compiler if you're writing C anyway...") You should use Win32.hlp file instead. It contains all the needed information. >Are there any alternative (higher-level) "COM-Port"-Bindings available? >All I need to do is write a stream of ASCII characters and read characters >with a timeout after x ms, in case somebody pulled the plug or whatever. Probably some time in a future we will have such OO Communication Libraries. Some time ago I suggested to RR Software (namely to Randall Brukardt) to think about developing and including high-level OO communication library into their future CLAW releases (to make it more closer to Delphi). Idea was that these OO libraries could use any available communication means (comm ports, sockets, pipes,mailslots, memory mapped files,NetBios e.tc.) for programs and equipment intercommunications. There are a lot of needs for that in a real life (in telecommunications area). May be they will do this. Maybe some others will be the first. Later I found that all that was already implemented as Adaptive Communication Environment (ACE) developed by Douglas C. Washington University in Saint Louis (http://siesta.cs.wustl.edu/~schmidt/ACE.html) . The only problem that it was written in C++. Maybe someone sometime will rewrite it totaly in Ada 95. This toolkit is freely available and may be used as an excellet example. >If anyone has some sample code that accesses a COM-port using Object Ada >I would be most grateful for a quick peek at it! There are many software components for COM ports written for Borland Delphi. Many of them can be easily rewritten in Ada 95. It is much more easy to translate code from Turbo Pascal to Ada 95 than from C++ to Ada. Also that things are invaluable knowledge base of high-level OOP programming under Windows NT. Delphi comes with source code and is very useful in that respect. There are also many professional communication tools from 3d party companies. Just have a look at (http://www.inprise.com/delphi/deltools.html) Communication Tools section and especially to the "Async Professional" toolkit from TurboPower Software Company. (http://www.turbopower.com/products/) . >(This is my second-ever >MS-Windows project, I hope it will be my last...) The Windows NT is not such bad thing at all. When you get grasp of it' concepts many things will appear very simple. Windows NT programming is definitely much more complex then DOS-like programming. It requires many calls to low-level APIs and programmer should know them very well to write good code. That's why Companies that make this process more easier have a lot of success. On the other hand Window NT is designed to make life easier for the "end users" and not for the programmer. It is well protected from programmers errors and badly written applications. It just shuts down application that is trying to do something wrong (e.g. directly access some system resources or other program resources). Only badly written drivers can put WindowsNT on the knees. Each system has it's own set of rules. If you do not obey that rules for any reason (e.g. - you just do not know them) then you may feel frustrated quite very often. This is just the same as with Ada. Regards, Vladimir Olensky (vladimir_olensky@yahoo.com) (Vladimir_Olensky@oxy.com) Telecommunication specialist, Occidental C.I.S. Service, Inc. ( www.oxy.com ) Moscow, Russia.