1 (edited by sigmaflo 2011-07-17 12:23:55)

Topic: Real time velocity graph

I am a first time user of Graph. 

Is it possible to use Graph in real time.

Treat me as a beginner with no programming experience,  but I would like to display on my laptop the following graph updating the display every second.:-


Object is to run a programme which will be similar to an automobile speedometer, displaying a number “N” as real time velocity in a digital figure format window, and a totaliser window underneath indicating total miles to date.

A             Store a number "D" which can be between 5 and 9999.

1    Input a continuous train of100 mV pulses to the mic socket of a laptop. These can vary in frequency from 20Hz     to 3kHz. This is the velocity information. 1 pulse = 3.5855 mm of movement.
2    Totalise the number of pulses from the mic socket over a one second period.
3    Store the total as a number “N” in memory and reset pulse totaliser to zero .
4    Keep repeating section 2-3, until programme receives a Stop command
   
When each 1 second count “N” becomes available, and before the next 1 second count is completed, the following calculation must be performed :-  ( 2.817*N*D*D ) / 1000000 .  The result shall be called “X”, stored in one memory space, and displayed as a decimal number to two places of decimals in a space within an on screen display box, and shown on  the graph y scale. This display ( and “X” in memory ) shall be updated every second. Time shall be the x scale of the graph.

All number X’s received from start of programme shall be added together and shown in a further screen box as a running total similar to an odometer, ( updated every second ) and shall also be stored in a single memory space for further manipulation.

The on screen velocity display shall be in user programmeable and selectable units eg. MPH or KPH etc.
Totaliser units shall also be user selectable eg Kilometres or Miles.

A section of the programme shall have user selectable Options, such as a Calibration facility whereby “X” errors may be removed and implemented, recording and charting over a period time, a pulse output every time a pre-determined number of miles are reached, etc  etc..

Any help would be very appreciated.

I am aged 73, so time is of the essence, only a few years left.

Kind regards.

Re: Real time velocity graph

Graph was not designed for this, but the scripting engine in the beta version of Graph 4.4 should be able to do it. You need to have Python 3.2 installed for it to work. There is not much documentation yet, but I am working on that.

However it doesn't sound like you want to plot a function or something like it at all. In that case you might have more success with using something else.