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,start X-Google-Attributes: gid103376,public From: lynch@cci.de Subject: Win NT + Object Ada: serial port I/O Date: 1999/02/03 Message-ID: <79952r$2t$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 440111277 X-Http-Proxy: 1.0 x15.dejanews.com:80 (Squid/1.1.22) for client 193.103.165.100 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Feb 03 09:32:10 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/3.0 (WinNT; I) Date: 1999-02-03T00:00:00+00:00 List-Id: 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. Rather than fork out the $XXX for something like Visual C++ (and a new HDD) I would like to develop using the Object Ada we already have. Does anyone have any information/experience programming serial ports in Ada on a Windows platform? I can think of two ways to do this: 1) Use the standard Ada.*.IO routines on the file "COM1:". I tested this with a VT420 on the other end and came across two problems: a) It seems the port needs to be "initialized" by calling MODE COM1: in a console window, even though the settings are exactly the same as those in the windows control panel. b) I need a timeout capability for the reply from the LCD/Terminal. Using Get or Get_Immediate without "Available" blocks indefinitely, all attempts to use Get_Immediate with loops and timers have failed. (Available seems to be _always_ false!?) 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...") 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. 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! (This is my second-ever MS-Windows project, I hope it will be my last...) Cheers, Andrew. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own