LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change X and Y scales?

hi nero tech

try this....

------------------------------------------------------------------------------------------------------------------
Indrajit

| indrajitbarve@gmail.com | indar_indar2005@yahoo.co.in .
Message 11 of 28
(1,160 Views)

Cory K:

The idea seems great! I found the property node, and wired the minimum to a constant equal to zero, and a maximum equal to ten (just to try it). The display window now extends from 0 to 10 which is great, but the data only fills a tiny portion of the window. (see below- note to dennis)

I also like your idea about  setting the maximum to "If time < 10 sec, then max= 10 sec, but if time >10 sec, then max= current time." How do you set to current time (where is that function)?

 

Dennis:

I think you have just figured out what the problem may be! I want the program to keep taking new data, and not re-writing (and re-displaying) the same values over and over again.  And I want the displayed data to continue to running, even when not being saved, such that the window will extend beyond 1 sec. I have opened the text file created when saving data, and there are well over 60000+ points, so data is still being taken, even though it is not being displayed.  Or is my file taking  and saving the same data over and over and over again in the text file? The is also an option in my program to read the previously saved files, and this graph also only displays a certain amount of data (the same amount on the graph that is taking the current data).  This is probably a good link to figuring out the issue.

How do I make the program continue taking new data?

-----

And a side note, once I have this issue fixed. How will I make the graph reset to zero, when I reset the data, instead of just continuing on from where is it was?

 

Thanks so much! 

 

Indrajit: 

I think you need to use the same version of LabVIEW that I am, because when I downloaded the new code it didn't properly take the data. Yes, a time stamp was placed on the bottom of the graph, but the window was still the same size, it just has the data stamp added. But thanks for you suggestions. Could you possibly tell me some of the changes that you made, that I might be able to try and implement into my code on my version LabVIEW.

0 Kudos
Message 12 of 28
(1,144 Views)

There is a function under timing called "Elapsed Time".

Wire the output of this function called "Elapsed Time (s)" to the maximum property.
This will update the maximum once every second.

 

For example, if the test was running for 30 seconds, the range will be 0-30 seconds.
If the test was running for 10 minutes, the range will be 0-10 minutes 

Cory K
0 Kudos
Message 13 of 28
(1,131 Views)

Answering your question on how to clear the graph programmatically: 

 

Rigth before any of your code begins (ie outside of all loops),

do the following.


(Assuming you are using a waveform chart, correct me if I am wrong)

- Right click the chart 

- Create >> Property node >> History Data (all the way at the bottom)

- Change this property to write

- wire a constant array of 0 to this node

 

This way, it will show the graph until you begin your next test.
At the beginning of the test, it will clear the graph. 

Cory K
0 Kudos
Message 14 of 28
(1,129 Views)

By the way, let me answer a question you are going to ask in a while before you ask it.

 

Once you get the displaying of your data working, you are going to notice that even if your x-scale is from 0 - 24 hours or more,

only about 5 or 10 minutes of data is displayed, older data is erased as newer data is displayed.

 

You are then going to say, "what just happened to all my old data? this is all Cory K's fault!"

By default, only about 1000 or so points are displayed at any given time, so 

 

To fix that,

- right click your graph

- click "chart history length"

- then make that number larger (however many point you think you will need to display) 

Cory K
0 Kudos
Message 15 of 28
(1,124 Views)
Thanks for all your insights, Cory! If you look above at the note I wrote, specifically the part addressed to Dennis, is where I am still having issues. The data is not going passed this point. It seems to be repeating itself and playing over and over again on the graph. If you read what I wrote to Dennis I think I explained it fairly well, do you have any suggestions?
0 Kudos
Message 16 of 28
(1,121 Views)

Using the elapsed time will force the chart to show ever increasing time spans. If you want to keep a fixed time span, then place your x.scale properties outside the loop and only run it once. Because the chart has a fixed history, the ever increasing time span will eventually show empty data at the beginning as that data is removed from the history.

Message 17 of 28
(1,117 Views)
I know, I addressed that problem before it arose :smileyhappy:
Cory K
0 Kudos
Message 18 of 28
(1,113 Views)
I tried using the elasped time, with the less than sign, but the wires wouldn't work. They had "x" across them. Why is this? I also tried adding in the history node, but I am not noticing that it does anything, but lets forget about this for now. I currently have the X-min and X-max values set to controls, so the user can adjust them as they desire, which is fine for now. The issue I am having now is trying to get the data to fill the entire graph window (ie-the data seems to not be saving beyond a few milliseconds, and it keeps replaying the same data over and over again in the window). Dennis, you mentioned you noticed this in my code before, that only a tiny bit of data is taken and then it keeps repeating, how should I go about fixing this? Cory K, your help is welcome to! Am I explaining myself well enough?
0 Kudos
Message 19 of 28
(1,103 Views)
DO NOT have the property nodes inside the loop where they are called with each iteration. If you want to give the user the ability to change the time span as the VI runs, then place the porperty nodes inside an event structure so it only gets called once and your should probably base the new min/max values on the current value. For example, if the user want to change the existing time span from 30 seconds to 1 minute, take the existing min, add to it, then set that value to be the new max.
Message 20 of 28
(1,089 Views)