comp.lang.ada
 help / color / mirror / Atom feed
From: "frikk" <frikker@gmail.com>
Subject: Re: Reading Float Data from a binary file into ada
Date: 30 Jan 2007 10:04:10 -0800
Date: 2007-01-30T10:04:10-08:00	[thread overview]
Message-ID: <1170180250.735903.10580@a34g2000cwb.googlegroups.com> (raw)
In-Reply-To: <wFLvh.247033$aJ.199486@attbi_s21>

On Jan 30, 12:56 pm, "Jeffrey R. Carter" <jrcar...@acm.org> wrote:
> frikk wrote:
>
> > Basically I need to be able to read in the binary data byte by byte
> > but store it into a 32 bit Float.  The C union example above uses the
> > same memory address for the Float as it does for the size 4 char
> > array. I don't even know if the VB dump will correspond with the way
> > ada handles floats or not, but I'll worry about that later.
>
> Any reason you can't call this C function from Ada?
>
> --
> Jeff Carter
> "I soiled my armor, I was so scared."
> Monty Python & the Holy Grail
> 71

Thank you for the responses so far.

We are using simulink and calling ada through s-functions.  If we use 
C, we'd have to get the data back to the matlab workspace, then pass 
it into an ada module.  It is prefered to keep all of the data inside 
the ada modules without coming back to the workspace.

I've been working with ada for awhile, but I'm still not very good at 
the syntaxes of more complicated data management commands.  How does 
ada store its floating point data? Is it stored like an ieee standard?

And yes - it appears that the data dumped is not actually a float but 
fixed point. This is how VB apparently handles 'Float' data types.

If I had data in a binary file, even disregarding the fractional 
piece, how could I get this into an ada variable? If I could even get 
a round about syntax to help me get started in setting up the memory 
locations and such that would be helpful. Its hard to find specific 
examples sometimes.

Thanks!
Blaine




  reply	other threads:[~2007-01-30 18:04 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-30 15:51 Reading Float Data from a binary file into ada frikk
2007-01-30 16:37 ` Dmitry A. Kazakov
2007-01-30 16:55 ` Jean-Pierre Rosen
2007-01-30 17:35   ` Ali Bendriss
2007-02-01 16:28   ` Ali Bendriss
2007-02-01 17:27     ` Jean-Pierre Rosen
2007-01-30 17:56 ` Jeffrey R. Carter
2007-01-30 18:04   ` frikk [this message]
2007-01-30 19:56     ` frikk
2007-01-31 18:30       ` Jeffrey R. Carter
2007-01-30 20:51     ` Robert A Duff
2007-01-31 18:25     ` Jeffrey R. Carter
2007-01-31 18:57       ` frikk
2007-01-30 19:31 ` Niklas Holsti
2007-01-30 21:14   ` Cesar Rabak
2007-01-30 21:36     ` frikk
2007-02-01 21:11   ` Simon Wright
2007-02-01 21:44     ` Niklas Holsti
2007-02-03 12:13       ` Simon Wright
2007-02-03 14:59         ` Gautier
2007-02-03 17:01           ` Simon Wright
2007-01-30 20:02 ` Martin Dowie
2007-01-30 20:09   ` frikk
2007-01-30 20:23     ` Martin Dowie
2007-01-31  3:54 ` Steve
2007-01-31  8:42   ` Maciej Sobczak
2007-01-31 14:12   ` frikk
2007-01-31 18:38     ` frikk
2007-02-01  0:05       ` Jeffrey R. Carter
2007-02-01  2:59       ` Steve
2007-02-01 16:05         ` Bob Spooner
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox