LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

set start and end time for a chart/graph

i would like to set fixed start and stop times for the scale chart/graph. start time should be 03:30, end time 20:30. at 1min intervalls, measurements are taken and should be displayed. the first measurement takes place after 03:30. hence the scale shows the maximum possible range, while the actual curve is plotted within this, with the last measurement taking place before 20:30.

Should i use a chart or graph?

How should i format the axis to display the data as described above?

many thanks
0 Kudos
Message 1 of 7
(4,747 Views)
Use a graph and make a buffer initialized to hold the number of measurements that will be taken (use a shift register as buffer). Set the start time (X.Offset) and delta t (Multiplier = 60 sec) of the graph and just replace the array elements in the buffer as new data becomes available. Turn off the "Loose fit" of the X scale, set the scale to be displayed in an absolute time format.
Message 2 of 7
(4,747 Views)
Thanx Mads.

im afraid i don't fully understand what you've written. im a labview newbie.
i've tried to implement what you've described but im not getting any luck. i've attached 2 VIs that i thought would work, but they don't even plot. please help. many thanks
Download All
0 Kudos
Message 3 of 7
(4,747 Views)
Attached is an example of the described solution.
0 Kudos
Message 4 of 7
(4,747 Views)
Unfortunately, i've not been able to explain myself adequately. i need the scale to start at 0330 and end at 2030. the actual start time of data measurement and thus display is the sunrise for every day (which is always past 0330, ie, the first measurement and point appear to the right of the min time of 0330)

i've tried to implement your example graph into my main VI but the extra while loop messes up the sychronization of the subVIs present in the main VI.

i've tried to use property nodes to set the X axis min and max but the max time is always automatically adjusted. (e.g. instead of showing 20:30:00, the max time is 03:47:00, NB: measurements are taken every minuate) i've switched off autoscaling.

i can achieve the desired re
sults if i manually set the scale extremes during run-time. However, this means that this has to be repeated every day. i hope to automate the process of setting the scale min and max.

Appreciate your help.
0 Kudos
Message 5 of 7
(4,747 Views)
The loop in the example I sent is only there to run the example, you need to use your main loop the way I've done in the example. The loop is only used to provide the shift registers to hold the presized array.
You will of course also need to initialize the array to the number of elements you will generate, not use the numbers I included in the example.

In the example I set the start time and delta t once outside the loop (do not set the x min and max, do as shown in the example, set the x.offset and multiplier), you can do this inside the loop and with the start time and delta t of your choice.

By initializing the array to the necessary size first and then use the resize function things will work smoothly and use little me
mory. Never build arrays using the build function unless it's very small arrays and/or you do it seldom...In a loop where you need to put in new elements on each iteration working with a presized array is a necessity.

I'm quite sure the example does what you intend to do, you just need to see what the core technique is and look past the things that are there just for the example.

If not though, try taking a picture of the code or upload it (include sub-VIs by saving with options -> development distribution) and I'll have a closer look.
0 Kudos
Message 6 of 7
(4,747 Views)
Hi Mads,

i think that i have failed to implement your recommendations correctly. i am still unable to achieve the desired results with your recommendations. Thanks for your help. ive taken a totally new and different approach and have solved the problem.
0 Kudos
Message 7 of 7
(4,747 Views)