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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6439f56f895df143 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-15 10:24:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.esat.net!feeder.news.heanet.ie!193.1.198.47.MISMATCH!not-for-mail Message-ID: <3DAC4F21.60B7A90D@ACM.org> Date: Tue, 15 Oct 2002 18:23:45 +0100 From: Colin Paul Gloster Reply-To: Colin_Paul_Gloster@ACM.org X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.8 i86pc) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: New to Ada..need some help regarding Binary Conversion?? References: <4ee1d187.0210150850.62ce918a@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Organization: Dublin City University (DCU) Cache-Post-Path: ns2-ext.dcu.ie!unknown@136.206.18.19 X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) NNTP-Posting-Date: 15 Oct 2002 17:24:16 GMT NNTP-Posting-Host: 136.206.1.1 X-Trace: 1034702656 reader.news.heanet.ie 178 [::ffff:136.206.1.1]:36669 Xref: archiver1.google.com comp.lang.ada:29808 Date: 2002-10-15T17:24:16+00:00 List-Id: Paula wrote: "Hello all, I am new to the Ada programming language and have worked through the wonderful material presented on Adapower.com and I have worked through the Lovelace tutorial. I was doing prototyping using File IO and have worked through most of the problems there. My biggest challenge is now I must read in a "data signal" (which is in binary, in the form of 16-bit words, can be over more than one word, and isn't in a file), convert it to decimal and apply the correct scaling data to convert it to engineering units, and then do the reverse (take in engineering units, convert to raw bus data). I can do the scaling part...no problem..it's the reading in (I don't understand how to get the input if it's not in a file or from the keyboard). A coworker suggested creating a big table of 16-bit binary arrays, that I could declare a data-type as binary (??). Any help would be appreciated. Thanks, Paula" Hello Paula. Where exactly is the data signal coming from? You may need to write a custom device driver to get at the hardware, and maybe an interrupt service routine too. For example mouse drivers are interrupt driven. You may find it helpful to read about representation clauses, such as address clauses for interrupts.