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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.42.196.71 with SMTP id ef7mr4915463icb.24.1391988398799; Sun, 09 Feb 2014 15:26:38 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!c10no13220130igq.0!news-out.google.com!s3ni13080qas.0!nntp.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 09 Feb 2014 17:26:38 -0600 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: Hello, and help with GNAT and Windows USB programming Date: Sun, 09 Feb 2014 18:26:38 -0500 Organization: IISS Elusive Unicorn Message-ID: References: X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 76.249.26.199 X-Trace: sv3-8JI45VGBkMZL4d6D/Tw1UQu1ZP0FxHveIoat8AUqsUSouB28oD3NzAJauhZGRKsLcb9WigPHeCyMqoE!tA47JPlHLa/dYmrMOLAipklqPt/1axd3r1Oy2ja4r4DiKAAF17pnkDmQLus/Mbhia0TN6s5WwcJn!vRW2OmSecOpsbu6lIYkf+upTGwU= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 4034 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Xref: news.eternal-september.org comp.lang.ada:18460 Date: 2014-02-09T18:26:38-05:00 List-Id: On Sun, 9 Feb 2014 11:59:41 -0800 (PST), Gumpy declaimed the following: > >So, to start with, I found a USB based thermocouple interface that will be used to sense the temperature inside the kiln. I'll add a USB based relay board to this, and the control software will tie it all together. > Adding multiple USB boards could add to the difficulty. Especially if the boards do NOT appear as serial COMx ports. In that case you may want to look for a copy of the book "USB Complete" (Jan Axelson). If they do appear as serial ports, you may still have the problem that they may not be on the same COMx port number each time you connect the boards. >I've never worked in programming a PC environment, and have no experience with programming USB ports. I'm not finding a lot of information online, but did find some past messages in this forum which alluded to Linux USB stuff. I thought I'd put out a request for some help and see if anyone will respond. > >1. When your laptop has several ports, how do you know or find out which port a device has been plugged into? Ultimately, I will need a couple ports for the thermocouple interface and the relay board. > You might want to consider something like http://www.velleman.eu/products/view/?country=be&lang=en&id=351346 which has a downloaded DLL (as I recall, one can wire up to 4 USB addresses, so one could access multiple cards if needed) [Hmm, I seem to have hit the European site]. Discontinued but I found one of these at Radio Shack last summer. You'd have to map the DLL into an Ada interface package... Or maybe this one; probably replaced the K8055 (and this is the link to the preassembled module) http://www.velleman.eu/products/view/?id=369162 (unfortunately, Amazon US says Unavailable; same for the K8061 kit version) >2. Using GNAT, and potentially GNAT.Serial_Communications, how does one open a USB port and read and write character strings to it (the thermocouple interface has a simple character based command language for setup and taking temperature readings). > >3. Does anyone have any specific code examples for communicating on a USB port that they would like to share, or a link to some example(s) online somewhere? > >I'm sure this probably is easier than I'm making it out, but I'm realizing I've forgotten (archived) a good deal of my Ada knowledge in the past decade of non-use, and so I'm just a bit overwhelmed trying to get up and running. I have the TDC-GCC-64 compilation system installed on my Vista laptop, and have it functional. My Hello World is working and I have found GNAT.Serial_Communications. That's about it so far. > >Any help that along these lines, including code snippets would be greatly appreciated. > >Craig -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/