取消
顯示結果 
搜尋替代 
您的意思是: 

Live editing multiple graphs

已解決!
前往解決方案

Hi all,

I have some issues with editing data. I have a program that reads a text file with data, does calculations to the data, and then displays it in a graph. There are 6 columns of data, so I want 6 different graphs. For every graph there are two things that needs to be done: calculating the mean and an offset. Now I want to edit data live, different for every graph. I want to be able to replace certain data points with NaN values. So lets say in a graph there is one data point that is abnormally high, I want to move two cursors to set the x-values, and to set an y-value, and then I want it to replace all the data points between the two x's and above the y with a NaN value. I also want this to work the other way around, so to replace values lower than a certain Y-value. I need the program to remember these alterations, and then be able to do the same for multiple points in that graph. I also need to be able to do this separately for every graph.

The problems I encounter are these:

- Remembering the alterations that are done. When I set a new area, the already altered area goes back to the original.

- Setting the cursors as coordinates. I know how to ask for the cursor coordinates with a property node, but I have trouble with passing that data.

- Doing this program for every graph. The final product will consist of approximately 30 graphs, so I was wondering if there is a way to do the above, without copying the program 30 times (or for now, 6 times).

Sorry if these questions are stupid, I'm still learning, and I get better at this every day 🙂

I've attached my program (yes, the real program now :p) I've also attached the data that I use to read.

I know this is a lot, but some tips are very welcome.

Thanks in advance!!

下載全部
0 積分
1 條訊息(共 18 條)
5,619 檢視

Hi all, 

Yesterday I posted a rather long question. Since there are no replies yet, I'm going to do it a bit different.

So, the question is this: I want to detect peaks and valleys in an array or in a waveform graph, and then replace those peaks/ valleys, with some datapoints around them with NaN values. I've attached my VI. I've tried the peak detection VI and the waveform peak detection VI but I have a lot of trouble wiring them up. I really hope someone can help.

Thanks in advance!

0 積分
2 條訊息(共 18 條)
5,568 檢視

sorry, forgot to add the text file i read from

0 積分
3 條訊息(共 18 條)
5,558 檢視

Hi lvl,

 

using real waveforms would make your live so much simpler:

check.png

Did you read the error message on that broken wire in the context help? It also mentioned the type mismatch between your datatype and the expected waveform!

 

P.S.: Next time PLEASE stick with your thread. No need to ask the same question in several places in the LabVIEW board!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 積分
4 條訊息(共 18 條)
5,556 檢視

Hi,

Thanks. Yes, I saw that I needed a waveform. I did not know how to do that. I'm learning new stuff every day.

I've managed to wire it up like you. But now I'm struggling with wiring up the waveform peak detection vi. I need to be able to extract the peaks and the valleys, and then replace them and all other data above a certain threshold (indicated by the y-cursor), with NaN values.

Sorry about the extra thread. I didn't see any harm in it.

lvl

0 積分
5 條訊息(共 18 條)
5,548 檢視

Hi lvl,

 

I need to be able to extract the peaks and the valleys, and then replace them and all other data above a certain threshold (indicated by the y-cursor), with NaN values.

PeakDetection gives you the position of the peaks. All you need to do is to replace the corresponding Y data in your waveform…

What have you tried? Where are you stuck?

 

Sorry about the extra thread. I didn't see any harm in it.

People will get annoyed by this behaviour once they recognize those multiple threads - especially when they provide help in their spare time just to notice someone else was answering the same question in a different thread!

Did you read the community guidelines?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 積分
6 條訊息(共 18 條)
5,543 檢視

Hi,

I'm stuck at the locations it gives me. They don't seem to be correct. I've attached an image to show what I mean. I also found this (http://forums.ni.com/t5/Example-Program-Drafts/Peak-Detection-and-Extraction/tac-p/3662206#M12530)  example, it seems to do what I want but I haven't been able to make it in my labview version (2011). I get stuck at getting the waveform into a for loop.

Also, I'm not sure how replace the Y data with the NaN. Is it possible to do this separately for every peak? Because I need to filter some peaks, but not all of them.

Sorry again for the extra thread, I will post a link there to this thread to prevent what you described.

Thanks,

lvl

0 積分
7 條訊息(共 18 條)
5,538 檢視
0 積分
8 條訊息(共 18 條)
5,536 檢視

oh my... I think I need some more sleep...

The location returns the index of the peak, not the x-value... right? 

But if this is correct, there should only be integers right? 

0 積分
9 條訊息(共 18 條)
5,518 檢視

i had made a peak detection snippet over there https://forums.ni.com/t5/Discussions-au-sujet-de-NI/Mesures-des-Pics-max-d-un-signal-provenant-d-quo...

 

perhaps it helps you. you have to adjust the threshold and can play with the width, and decide wether you want to find peaks or valleys.

just read the help for "Peak Detector.vi"

 

UPDATE: in my example i would recommend you to set the threshold to "1 - (mean+stddev)" and the type to be found to "valley"

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 積分
10 條訊息(共 18 條)
5,516 檢視