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 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!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!s09-01.readnews.com!not-for-mail X-Trace: DXC=U>@9McDn^O3EU8YbCJfQG<[3OhcoN[H00X44`8^\]>7:8DHB_I2k0T046;bH^b Newsgroups: comp.lang.ada Subject: Re: Hello, and help with GNAT and Windows USB programming Message-ID: <20140212072102.20262da0@lufsen.sandat.dyndns.org> References: X-Newsreader: Claws Mail 3.9.0 (GTK+ 2.24.8; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 00124aa5.ngroups.net X-Received-Bytes: 4003 X-Received-Body-CRC: 367507685 Xref: news.eternal-september.org comp.lang.ada:18498 Date: 2014-02-12T07:21:02+01:00 List-Id: Three small steps on the way. 1) get a decent header file with an interface specified in C K8055D.h 2) g++ -c -fdump-ada-spec K8055D.h 3) look into k8055d_h.ada and use it. Given that you are using a fairly modern gnat/gcc /Per On Sun, 9 Feb 2014 11:59:41 -0800 (PST) Gumpy wrote: > First, hello. I'm new here. Forgive me if I'm unfamiliar with this > and guide me. > > Next, I've been an embedded software engineer for 25+ years, with 18+ > in Ada, though I have not worked with Ada for nearly a decade. Pretty > much all of my career has been embedded real-time applications, so > I've had very little experience with the PC environment, other than > from a user perspective. > > I'm also an up and coming potter. It's a hobby I intend to use to > help support my retirement some day. > > I have decided that in order to get myself back into Ada and also > learn something about programming in the PC environment that I am > going to build a kiln controller to convert my manual electric > pottery kiln to a fully automatic kiln. I know I could buy an add-on > controller for a few hundred dollars, but what's the challenge in > that? I figure I can build a simple system that suits my needs and is > expandable as I see fit. I can define custom firing schedules that > other systems don't accommodate. Ultimately, I may set it up to > control multiple kilns. > > 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. > > 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. > > 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