My situation briefly described :
serial data samples are arriving about a 1K byte size several times per second
c program fopen'ed to tty - prepends gnuplot instructions, orders incoming bytes to numbers and pipes results into gnuplot
Simplified example of c program output
set terminal wxt noraise background rgb 'sea-green'
set autoscale
set title "Collected Data"
set yrange[-0.5:4.0]
set xrange[0:128]
plot "-" u (1.000000*$1):2 with lines lw 3 lc rgb 'dark-red', "" u (1.000000*$1):3 with lines lw 3 lc rgb 'dark-blue'
0.750 3.204 3.211
1.750 0.150 0.139
2.750 0.127 0.118
3.750 0.109 0.098
4.750 0.091 0.085
5.750 0.081 0.074
e
- the output of the c program is piped into gnuplot (./cprog | gnuplot)
The gnuplot window updates with new data several times per second, BUT, the two graphs are not from the same data sample. It's sorta like each time through only one of the plot commands is executed. So, I'm looking for a way to get my traces synced - what's the best way to do this? (Hoping to keep update rate >1Hz)