comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Real time signal processing using PV-WAVE
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Real time signal processing using PV-WAVE [message #17737] Fri, 12 November 1999 00:00 Go to next message
dibanella is currently offline  dibanella
Messages: 1
Registered: November 1999
Junior Member
Dear all,

I am a new user of PV-WAVE and I'm in trouble because I have
to process signals in real time but I have no Iidea about the way to
do this. Does anyone know if it is possible to acquire data directly
using PV-WAVE and process them, for example, every two or three
seconds ?

Thank you (I really need your help)

Anna Maria di Banella
Re: Real time signal processing using PV-WAVE [message #17836 is a reply to message #17737] Tue, 16 November 1999 00:00 Go to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <382f0f43.282258890@news.remarq.com>, dibanella@usa.net (Anna Maria di Banella) writes:
> Dear all,
>
> I am a new user of PV-WAVE and I'm in trouble because I have
> to process signals in real time but I have no Iidea about the way to
> do this. Does anyone know if it is possible to acquire data directly
> using PV-WAVE and process them, for example, every two or three
> seconds ?

I have done this a lot using LINKNLOAD in PV-WAVE, which is almost identical to
CALL_EXTERNAL in IDL. You need to do the following:

- Make a C "wrapper" which calls your existing data collection routines. This
wrapper is necessary to convert between the way LINKNLOAD passes its
arguments and the way your existing code will pass arguments.

- Link this C wrapper and your existing routines into a DLL (Windows) or
shareable object (Unix).

- Write PV-WAVE routines to call the DLL or shareable object.

Using this technique I have done lots of data acquisition and display using
PV-WAVE and IDL. Update rates faster than 100 Hz are easily achieved,
depending on how much data you need to display.

____________________________________________________________
Mark Rivers
CARS
Univ. of Chicago
5640 S. Ellis Ave.
Chicago, IL 60637
and
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
Re: Real time signal processing using PV-WAVE [message #17846 is a reply to message #17737] Mon, 15 November 1999 00:00 Go to previous message
williamm is currently offline  williamm
Messages: 2
Registered: September 1999
Junior Member
In article <382f0f43.282258890@news.remarq.com>, dibanella@usa.net (Anna
Maria di Banella) wrote:

> I am a new user of PV-WAVE and I'm in trouble because I have
> to process signals in real time but I have no Iidea about the way to
> do this. Does anyone know if it is possible to acquire data directly
> using PV-WAVE and process them, for example, every two or three
> seconds ?

Sure thing. There are several options depending on exactly
what data gathering scenario you have in mind. I am assuming
that you have some hardware-based data collection system that
has an associated API for hardware control and data-stream
output.

Given this assumption, the fastest and most direct way to
feed data to PV-WAVE for processing is via the CWAVEC/OPI
API. A second means would be to direct output from a control
process to a pipe and have PV-WAVE read from that pipe.

CWAVEC is a PV-WAVE/C language command interface that allows
you to directly call PV-WAVE from C for command execution.
PV-WAVE itself is statically linked to your executable,
which makes for a _large_ executable size, but affords
the advantage of memory sharing: the C executable has
direct access to the memory associated with variables
in PV-WAVE via the OPI (Option Programming Interface) API.
The OPI functions allow the programmer to get pointers or
handles to PV-WAVE variables. Thus a programmer can create
a FLTARR via a command call to the cwavec function (or
more directly, the wave_execute function), then get a pointer
to the PV-WAVE variable associated with that FLTARR
via the wave_get_WVH function, and then make assignments
to that PV-WAVE variable via the wave_assign_num function.
The above OPI functions, and many more, are covered in detail
in the hard-copy or on-line document: "GUI Application
Developer's Guide". This memory-assignment process has
the advantage of being much faster than pipe I/O.

Once you have made the relevant memory assignments,
and thus have your data tucked in a PV-WAVE variable,
subsequent calls to wave_execute can be initiated to
call PV-WAVE functions to perform analysis on that variable
or variables. Of course, if you are repeating this process
every two to three seconds, you would want to do some sort
of buffering before calling any analysis once your data
set gets very large. You certainly don't want to be calling
an FFT on a 1 x 10^6 element FLTARR every 3 seconds--you'll
certainly run out of memory and bog performance down immensely.

If you prefer pipes, check out the EXEC_ON_SELECT procedure.
It allows PV-WAVE to initiate a callback that can contain
I/O and analysis upon detecting I/O activity on a named
pipe. This process would be simpler to program, but slower
than the OPI/CWAVEC route.

But, I can tell you that it can and has been done. Following
essentially the steps outlined above with CWAVEC/OPI, I helped
develop an application that fed satellite telemetry data
gathered at approximately several data points every 1-2 seconds
into PV-WAVE to be plotted on a strip-chart type graphic for
display and analysis.

Hope this helps!

Regards,
M. Williams
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Good substitute for IDL
Next Topic: Command input window in Windows: why only one line?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 01:18:37 PDT 2025

Total time taken to generate the page: 0.24279 seconds