read data from pgnuplot via pipe

read data from pgnuplot via pipe

Post by christophe Prad » Fri, 25 Oct 2002 21:52:33



Hi,
i'm porting a Linux app on Windows (Visual C++) which use bidirectional pipes.
Is it possible to open a pipe in "r" and "w" mode with pgnuplot?
And how can i do this?

Thanks.

 
 
 

read data from pgnuplot via pipe

Post by Hans-Bernhard Broeke » Fri, 25 Oct 2002 22:01:06



> i'm porting a Linux app on Windows (Visual C++) which use
> bidirectional pipes.  Is it possible to open a pipe in "r" and "w"
> mode with pgnuplot?

Not that I'd know of.  pgnuplot only emulates what you can get at
using popen() on Unix.  It doesn't try to do everything you can do
using pipe(), let alone any of the more advanced concepts available on
Unix (shared mem, semaphores, bidirectional pipes, ...)

The connection between pgnuplot and wgnuplot is strictly one-way:
pgnuplot sends simulated keystrokes to the wgnuplot window.  
--

Even if all the snow were burnt, ashes would remain.

 
 
 

1. lost pipes with pgnuplot

Hello,

I've scanned the postings in this newsgroup about piping, and they
allready helped me a lot. I also consulted Hans-Bernhard Broekers
Homepage
http://www-h1.desy.de/~broeker/gnuplot/pgnuplot_explanation.txt
for description of pgnuplot. So thanks up to now.

But now I'm really stuck. Here's my problem:

I'm currently writing some interface program for a measuring system to
display data via wgnuplot. I'm using Borland C++ 4.02 on a W98
environment.

Currently I'm sampling all necessary commands in a temporary batch
file. After closing this, I'm using pgnuplot to invoke gnuplot and
have the graph plotted with the "load" command. Up to this everything
works fine. If I would be content just to see the graph flash up for
some ms, the program would finish correctly.

The problem is that I want to pause the program until the user strikes
a key. And this is impossible up to now. The point is: As soon as I
open the pgnuplot-stream, my C-program loses control of the keyboard
completely. So the proposition of the above homepage - insert some
"getchar" -command to wait - simply sends the program into Nirvana. In
fact I have to manually "kill" pgnuplot via taskman to have a clean
system again.

I allready confirmed that it is "_popen pgnuplot": A "getchar"
immediately before works fine, one immediately after is a killer. It's
the same for "_pclose" in reverse.

The other possibility would be the "pause" command of gnuplot itself.
But this one is just useless in a Windows environment, because either
a) you use a positive argument. Now you have to wait a predefined
time, no matter what you actually want.
or
b) you use a negative argument. This makes a large window pop up in
the middle of your plot, asking for confirmation. No go in any cerious
application.

Has anybody seen this before? Any possibility to avoid it?
Thanks in advance.

Yours,
Ralph

2. Help me about Opengl Texture mapping(loading)

3. Q: X-profile-plotprogr reading data from pipe ?

4. alpha blending code to blend within 0xff-220

5. reading data from a pipe

6. Max Crash - HELP?

7. using gnuplot (Windows NT4.0) via pipes

8. Q: repeated commands via pipe or fifo?

9. Easy way of graphing piped data?

10. Piping data and 3D coordinates

11. HELP: displying raw data piped through functions possible?

12. Piping data from perl?