comp.lang.ada
 help / color / mirror / Atom feed
* from LabView to Ada? HowTo?
@ 2013-01-12  0:57 Mutek
  2013-01-12  2:00 ` Patrick
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mutek @ 2013-01-12  0:57 UTC (permalink / raw)


Hello,

I wuold like to investigate if is possible to migrate or just restart 
over from an actual LabView Windows environment to a multiplatform Ada/
Gnu/Linux based solution.

I use LabView to do very simple datalogging with a lot transducers: 
analog hight pressure transducers, thermocouple/temperature transducers, 
LVDT analog and PWM/digital datalogging and so on.
I'm just using some very expensive NI boards but I would like to stay 
away from them.

Is there a way to use Analog/Digital IO boards with GNU/Linux and program 
direct with Ada?
Do you know if it's possible and how? (pointing me to some working 
reference)

I mean something very closed to Arduino hardware but more professional in 
terms of measurement precision.
Arduino needs to load the firmware via Processing so it's a bit far from 
what I mean (using Ada to metacompile Processing and then inject into the 
board)...I mean something closed to what you can do in C when vendors 
give you the drivers and the .h to develop direct your solution...
So how can I do this in Ada?

Thank you in advance for your feedback,

m



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: from LabView to Ada? HowTo?
  2013-01-12  0:57 from LabView to Ada? HowTo? Mutek
@ 2013-01-12  2:00 ` Patrick
  2013-01-12  9:33 ` Dmitry A. Kazakov
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Patrick @ 2013-01-12  2:00 UTC (permalink / raw)


Hi Mutek

I work with scientific instruments and am of course interested in Ada.

I attended a labview seminar and I have played with it a bit but that was more then 10 years ago.

First question, what sort of boards are you using? Do you need GPIB? GPIB is a bit of a problem on Linux but not insurmountable. I can discuss if you are interested...

There are graphing libraries that have Ada support, I can send links if interested.

Ada can interface quite well with C but there is also quite a lot of complexity. I am not aware of any data acquisitions libraries freely available in Ada so you will likely have to bind.

GNATCOLL has a Python binding in it, you might want to consider a mixed Ada Python solution.

How many bits of resolution do you need with your A/D ? Labjack might be an option.

I usually can only work on programming related tasks when I am exhausted and the kids are in bed. I make very slow progress but if you need help I would like to help-Patrick



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: from LabView to Ada? HowTo?
  2013-01-12  0:57 from LabView to Ada? HowTo? Mutek
  2013-01-12  2:00 ` Patrick
@ 2013-01-12  9:33 ` Dmitry A. Kazakov
  2013-01-12 11:07 ` Brian Drummond
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Dmitry A. Kazakov @ 2013-01-12  9:33 UTC (permalink / raw)


On Sat, 12 Jan 2013 00:57:59 +0000 (UTC), Mutek wrote:

> I wuold like to investigate if is possible to migrate or just restart 
> over from an actual LabView Windows environment to a multiplatform Ada/
> Gnu/Linux based solution.
> 
> I use LabView to do very simple datalogging with a lot transducers: 
> analog hight pressure transducers, thermocouple/temperature transducers, 
> LVDT analog and PWM/digital datalogging and so on.
> I'm just using some very expensive NI boards but I would like to stay 
> away from them.
> 
> Is there a way to use Analog/Digital IO boards with GNU/Linux and program 
> direct with Ada?

Depends on what you mean under "direct." But in the context of having it
multiplatform, inexpensive, maintainable etc, the answer is no.

You cannot access hardware (PCI boards) directly under Linux or Windows
(you could under say VxWorks, but should not either). You will need a
driver for that. And you will need some layer (middleware) to abstract the
OS and driver specifics and especially to protect yourself from vendor
changing their API (they do).

> Do you know if it's possible and how? (pointing me to some working 
> reference)
> 
> I mean something very closed to Arduino hardware but more professional in 
> terms of measurement precision.

What is that? A single-board PC?

Anyway, I/O boards and integrated GPIO may look attractive at first glance,
but in the end appear economically infeasible, unless you are Boeing.

At cbb software GmbH we face this problem regularly. We deploy I/O
terminals instead. There is a huge number of vendors and many protocols
(so-called field bus protocols) of such terminals, e.g. CAN-based, ModBus,
EtherCAT, XCP, CCP, FlexRay and so on. I/O boards practically vanished from
automation in the recent decade.

For non-RT, and if you wanted to implement it yourself from scratch, you
could use ModBus would be the simplest. E.g. Wago 750 series

http://www.wago.de/media/02_products/m07500881_00000000_0en.pdf

For RT EtherCAT is the best choice. It is also less expensive than ModBus.
But the protocol is extremely complex, so you would need to buy a
commercial EtherCAT master software.

> Arduino needs to load the firmware via Processing so it's a bit far from 
> what I mean (using Ada to metacompile Processing and then inject into the 
> board)...I mean something closed to what you can do in C when vendors 
> give you the drivers and the .h to develop direct your solution...
> So how can I do this in Ada?

We have a middleware layer which our application software (in Ada and other
languages) accesses. The vendor-specific hardware is docked at the
middleware, using vendor API, if available. Data logging and/or database
access is done at the middleware level of course.
 
-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: from LabView to Ada? HowTo?
  2013-01-12  0:57 from LabView to Ada? HowTo? Mutek
  2013-01-12  2:00 ` Patrick
  2013-01-12  9:33 ` Dmitry A. Kazakov
@ 2013-01-12 11:07 ` Brian Drummond
  2013-01-12 20:28 ` Per Sandberg
  2013-01-14  9:15 ` Jacob Sparre Andersen
  4 siblings, 0 replies; 6+ messages in thread
From: Brian Drummond @ 2013-01-12 11:07 UTC (permalink / raw)


On Sat, 12 Jan 2013 00:57:59 +0000, Mutek wrote:

> Is there a way to use Analog/Digital IO boards with GNU/Linux and
> program direct with Ada?
>...I mean something closed to what you can do in C when
> vendors give you the drivers and the .h to develop direct your
> solution...
> So how can I do this in Ada?

If you have the drivers and header files to let you work in C, then you 
can work in Ada.

The rest depends on the devices you are using (or choosing).

Can you pick a small pilot project and re-implement that, or would you 
have to migrate all-or-nothing?

- Brian



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: from LabView to Ada? HowTo?
  2013-01-12  0:57 from LabView to Ada? HowTo? Mutek
                   ` (2 preceding siblings ...)
  2013-01-12 11:07 ` Brian Drummond
@ 2013-01-12 20:28 ` Per Sandberg
  2013-01-14  9:15 ` Jacob Sparre Andersen
  4 siblings, 0 replies; 6+ messages in thread
From: Per Sandberg @ 2013-01-12 20:28 UTC (permalink / raw)


Well given a few prerequisites:
* The card manufacturer:
  - has provided a driver
  - has provided a header file to be used to interface their product in
    the language C and are providing some interface in an  .so-
    or .dll- file.

* You are using a fairly modern GCC/GNAT.

I would use the "-fdump-ada-spec" option to gcc to get specs
representing the manufacturers API.
And with those specs you will be able to do what ever you want.
You might have a look on https://github.com/persan/zeromq-Ada to get
some ideas.
/P

On Sat, 12 Jan 2013 00:57:59 +0000 (UTC)
Mutek <mutek@inventati.org> wrote:

> Hello,
> 
> I wuold like to investigate if is possible to migrate or just restart 
> over from an actual LabView Windows environment to a multiplatform
> Ada/ Gnu/Linux based solution.
> 
> I use LabView to do very simple datalogging with a lot transducers: 
> analog hight pressure transducers, thermocouple/temperature
> transducers, LVDT analog and PWM/digital datalogging and so on.
> I'm just using some very expensive NI boards but I would like to stay 
> away from them.
> 
> Is there a way to use Analog/Digital IO boards with GNU/Linux and
> program direct with Ada?
> Do you know if it's possible and how? (pointing me to some working 
> reference)
> 
> I mean something very closed to Arduino hardware but more
> professional in terms of measurement precision.
> Arduino needs to load the firmware via Processing so it's a bit far
> from what I mean (using Ada to metacompile Processing and then inject
> into the board)...I mean something closed to what you can do in C
> when vendors give you the drivers and the .h to develop direct your
> solution... So how can I do this in Ada?
> 
> Thank you in advance for your feedback,
> 
> m





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: from LabView to Ada? HowTo?
  2013-01-12  0:57 from LabView to Ada? HowTo? Mutek
                   ` (3 preceding siblings ...)
  2013-01-12 20:28 ` Per Sandberg
@ 2013-01-14  9:15 ` Jacob Sparre Andersen
  4 siblings, 0 replies; 6+ messages in thread
From: Jacob Sparre Andersen @ 2013-01-14  9:15 UTC (permalink / raw)


Mutek wrote:

> Is there a way to use Analog/Digital IO boards with GNU/Linux and
> program direct with Ada?

Yes.  You can bind Ada routines directly to the GNU/Linux (C exported)
API for the board.  Fictive example:

   subtype Port_Number is Interfaces.C.int range 0 .. 3;
   procedure Initialize (Port : in    Port_Number);
   pragma Import (Convention    => C,
                  Entity        => Initialize,
                  External_Name => "binit");


> I mean something very closed to Arduino hardware but more professional
> in terms of measurement precision.  Arduino needs to load the firmware
> via Processing so it's a bit far from what I mean

I think you have misunderstood how the Arduino platform works.  You can
write Ada (with some limitations) applications directly for the Arduino
platform without going through Processing or the Arduino IDE.

Greetings,

Jacob
-- 
"There is a slight error in the exponent" - quantum vacuum
 mass is 10^35 times the total dark matter mass



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-14  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-12  0:57 from LabView to Ada? HowTo? Mutek
2013-01-12  2:00 ` Patrick
2013-01-12  9:33 ` Dmitry A. Kazakov
2013-01-12 11:07 ` Brian Drummond
2013-01-12 20:28 ` Per Sandberg
2013-01-14  9:15 ` Jacob Sparre Andersen

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