LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding manipulation of arrays in XY graph

Solved!
Go to solution

Hi everyone, i have created a VI that read data from a file. My X-axis display the time from 0-120s and my Y axis is the amplitude of the signal. I want to be able to display the signal from a specific point of time and not sure how to do it. In order words, when i choose 0-3seconds, the graph will show the signal from that range.Appreciate all suggestions!

 

Subsequently, i will like to display individual signals on the graph from 120spectra that i have inside the graph.

 

Attached below is the VI as well as text file of my signal data.

Download All
0 Kudos
Message 1 of 7
(2,551 Views)
Solution
Accepted by topic author LucaSoup

1. Just use a property node for the XY Graph.  The properties you are looking for are X Scale->Range->Maximum and X Scale->Range->Minimum.

2. Right-click on the plot legend (where it shows the colors for each plot.  There is an option for Plot Visibility Checkbox.  Enable that and it will do the work on your Boolean array.  You might also want to turn on the Vertical Scrollbar for the plot legend.

 

With these two things, you will no longer need to manipulate the data and rewrite to the graph.  1 is just a simple property write when your scale needs changed.  2 requires no code on your part.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 7
(2,531 Views)

Hi crossrulz! I understand your suggestion and i created the property node but whenever i input a range the graph will flicker to that time range and back to the original and keep on flickering between the two. Is this due to the while loop? Sorry i am rather new to labview. But thank you so much, your suggestion is great!

 

Attached below is the new VI with XY property node.

0 Kudos
Message 3 of 7
(2,519 Views)

Hi Luca,

 

switch off the x axis autoscaling of the graph…

 

You should call this property node only, when there is a value change event of the XScale.Range-controls! No need to set those properties each 50ms in the timeout event…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(2,500 Views)

Hi GerdW! Thank you for your suggestion, worked like a charm! Now my program is able to display the signals at a particular time. 

As for the second part of my problem, anyone has suggestions on how i can just focus on one particular signal? Now i have 120 different signals. Is there any way to focus on each individual signal so i can perform peak to peak calculations on it. I tried using event structure with remove array data but it proves to be inefficient.  

0 Kudos
Message 5 of 7
(2,492 Views)

@LucaSoup wrote:

As for the second part of my problem, anyone has suggestions on how i can just focus on one particular signal? Now i have 120 different signals. Is there any way to focus on each individual signal so i can perform peak to peak calculations on it. I tried using event structure with remove array data but it proves to be inefficient.  


Use an enum or ring to have the user select which signal to do the calculations on.  Then you just use Index Array to isolate the signal.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 7
(2,464 Views)

Hi Crossrulz! I have tried to follow your suggestions but ran into some problems. If i am not wrong, you are suggesting i put the signal through an index array and display the signal through (rows/column) by using an Enum probe. However, now i cannot connect back to XY graph due to different dimensions of array. 

 

Any tips on where i am doing wrong, Thanks! (attached below is my failed try VI)

0 Kudos
Message 7 of 7
(2,451 Views)