LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change X and Y scales?

I am going to label my issues for ease (even though they are all inter-related), so that if you choose to only answer one part, just place the number next to your response. Thanks!

 

(1) I am uploading the newest version of program. I still have the property nodes of X-min, and X-max inside the loop, but they are attached to controls which allows the user to adjust them as they see fit.  I placed the history property node outside the while loop, but I'm not sure if I hooked it up properly, because I would like the graph to not delete points as it keeps running (ie- I want the user to be able to zoom in and out of the waveforms on the screen and still be able to look back more than 1000 points ago). If I understand correctly the history node should be able to help the graph continue to run the the data and display beyond the 1000 points, is this correct?  

 

(2) I am still having an issue with the program taking data beyond a certain point. The program will take the data from a short while, and then it keeps displaying the same thing over and over again.  I am not sure how to fix this. (Am I not explaining this problem well enough?) 

 

(3)Also, if you look to the right side of the graph on my front panel, I have placed a reset button which ends the "session," but starts a new one. It makes the file you were saving end, and prompts you to begin saving a new file, or you can hit cancel if you wish to run the program without saving. When this button is pressed, I would like the graph to clear, so that all the user sees is the data that has been taken since the new "session" has begun. (this may already be the case, but because of my 2nd issue, the graph appears to only be displaying the limited amount of data over and over again. by solving issue 2 this problem may not even be an issue.)

 

Thanks again!

🙂 

0 Kudos
Message 21 of 28
(1,196 Views)

I forgot to post my updated code...

so here it is! 

0 Kudos
Message 22 of 28
(1,195 Views)
2. You've explained the issue but you have not implemented a single one of the suggestions to fix it. Why do you continue to have the same values written to the property nodes in the loop over and over again. You can't do that and have the chart update. I've said the same thing a couple of times now. Either change your program as recomended or not but if you don't change it, stop asking why your chart is not updating.
Message 23 of 28
(1,192 Views)
Here's a very simple program that demonstrates the difference between what you continue to do and a basic implementation of what I suggested.
Message 24 of 28
(1,181 Views)

The reason I am not placing the min and max values outside the loop, is because when I do I can't change the values, I want to be able to control the window size by just typing in a  number. When its on the outside, you can only control the starting values for the frame size. I see how on your program you have control over the window frame size, yet it is constantly increasing, while I do want that. I also want the data to be scrolling across the screen (like on a real oscilloscope). 

So far the only way that I can get the data to actually fill the screen is by increasing the buffer size, sample size, and samples  to read to astronomical levels that it causes the program to run very slowly. Do you understand what I am explaining?

0 Kudos
Message 25 of 28
(1,169 Views)

You either place the property node outside the window or you place it inside an event structure like my example. Placing it inside a case statement would work as well. For the last time, YOU CANNOT WRITE TO IT EVERY ITERATION.

 

My example does NOT have an ever increasing size. It is fixed and equal to whatever duration is set. Old data scrolls off to the left and new data is appended on the right. That is how a chart works.

Message 26 of 28
(1,166 Views)

I do understand what you are telling me as far writing for every single iteration, but I have tried placing case structures around it, and the program no longer runs at all. I just get a blank display on the graph. Yes, the scale on the X axis looks pretty (ex- from 0 to 10), but there is nothing  being displayed. 


0 Kudos
Message 27 of 28
(1,153 Views)

How dennis wrote his program, the xscale will be set once, and it will stay like that for the rest of the run.

 

- If that is OK for you, use that.

- If you wanted the scale to grow as you collected more data,

you would have to put the property write function inside an event structure, that was inside the while loop

For example, everytime the time is a multiple of 10 seconds (ie 10, 20, 30, etc) write to the property node again to update your scale.

Or something like that, I am just giving you ideas.

 

However, Dennis is correct. You can not just put the property node inside the while loop by itself, it cannot write to the node every iteration. 

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