ritesh024 Posted October 4, 2008 Report Share Posted October 4, 2008 Dear all, I am working on an application where i am recieving data at 5 ms/Division and i am plotting it on Waveform Graph with X-Scale 0-100. Now, i want to show tha same data at 10 ms/D. i.e the whole data will be shown on 50 points now. PS: i dont want to change the scale of the Graph. X-Scale of the Graph will still be 0-100 . How can i do it in LV? Thanks, Ritesh Quote Link to comment
Minh Pham Posted October 8, 2008 Report Share Posted October 8, 2008 QUOTE (ritesh024 @ Oct 4 2008, 05:41 AM) Dear all,I am working on an application where i am recieving data at 5 ms/Division and i am plotting it on Waveform Graph with X-Scale 0-100. Now, i want to show tha same data at 10 ms/D. i.e the whole data will be shown on 50 points now. PS: i dont want to change the scale of the Graph. X-Scale of the Graph will still be 0-100 . How can i do it in LV? Thanks, Ritesh To make your graph acts like an ocsilloscope you need to design its bahavours. In this case, the scale factors for X and Y axis. To have V/Div and Time/Div settings you must also have a Reference values for both axis, then use this Ref value to calculate the scaling factor based on user input. Eg. the X ref is: 10ms/Div, if user select 5ms/Div then the scale factor for X axis is: XScaleFactor = XRef/Select = 10/5 = 2. (zooming in) etc... To explain this idea you can play around with the simple vi i created in order to understand how a waveform is plotted on the graph before writing functionalities for it. I suggest you to create a subvi to handle the scale factor and X or Y data array. For further info, you can also look at the paper attached for reference purpose. Good luck and have fun. QUOTE (Minh Pham @ Oct 7 2008, 10:51 AM) To make your graph acts like an ocsilloscope you need to design its bahavours. In this case, the scale factors for X and Y axis. To have V/Div and Time/Div settings you must also have a Reference values for both axis, then use this Ref value to calculate the scaling factor based on user input. Eg. the X ref is: 10ms/Div, if user select 5ms/Div then the scale factor for X axis is: XScaleFactor = XRef/Select = 10/5 = 2. (zooming in) etc... To explain this idea you can play around with the simple vi i created in order to understand how a waveform is plotted on the graph before writing functionalities for it. I suggest you to create a subvi to handle the scale factor and X or Y data array. For further info, you can also look at the paper attached for reference purpose. Good luck and have fun. the paper to attached here... Quote Link to comment
ritesh024 Posted October 8, 2008 Author Report Share Posted October 8, 2008 Thanks Minh Pham. That is really a nice approach. After trying hard on NI forums, i got a solution which used "decimate 1D" array to get the desired result. And your solution looks really simple. Thanks, Ritesh Quote Link to comment
ritesh024 Posted October 9, 2008 Author Report Share Posted October 9, 2008 Thanks Minh Pham. You are inputting the values of offset and multiplier of the X-Axis to a cluster and then outputting the clustered value to a graph. That is not changing the scale of the Axis but the data only. Is it possible to send the 1D array of scaled data to the graph and not the Cluster of 3 elements? Actually, i have already completed 50% of the project and all time i am sending 1D array of data to the graph. not it would be really tough to change !D array of data to cluster of 3 elements. Thanks, Ritesh Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.