LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data as an array and create a graph for processing

Solved!
Go to solution

Thanks, I solved the case structure issue.

I'll post the rest of my problems in a new post. thank you

0 Kudos
Message 21 of 29
(609 Views)

Hello!!

I created a program that draws a graph by inputting a text file.

Then, calculations are performed using graph data and newly received input data.

 

     1. When I click on the file path to load it, the graph disappears after 10ms. I think it's because I set a timeout. However, the while loop does not                run unless a timeout is set in the case structure. What should I do?

     2. I want to plot the “input mean” and “input temperature” values I received on the xy graph. I want to keep adding new points to the graph.

         Of course, new points added are only added to the graph, not to the file.

     3. When we press the “matching button” for “input mean” and “extraction temperature”, we want to store them in the “input mean/extraction 

      temperature” array. I also want to add a function that clears the array data and new point in graph when the “Clear Array” button is pressed.

please help me

I'll attach my vi and example data.

thank you!

Download All
0 Kudos
Message 22 of 29
(640 Views)

Hi nick,

 


@nickbruk wrote:

When I click on the file path to load it, the graph disappears after 10ms. I think it's because I set a timeout. However, the while loop does not run unless a timeout is set in the case structure. What should I do?


Simple answer: because there is a "default if unwired" output at the event structure. The default value for an array is an empty array…

 

The more important question is: Why do you need to recreate the graph in each iteration?

The graph does not change after file loading so it would make sense to fill the graph INSIDE the event case!

Otherwise you need to store the plot data in a shift register - a solution already knwon to you…

 


@nickbruk wrote:

I want to plot the “input mean” and “input temperature” values I received on the xy graph. I want to keep adding new points to the graph.


When you want to "add new points to a plot" then you need to create arrays.

To create arrays over multiple iterations you should use shift registers and BuildArray.

This is very basic LabVIEW stuff and you already use such stuff in your VI…

 


@nickbruk wrote:

When we press the “matching button” for “input mean” and “extraction temperature”, we want to store them in the “input mean/extraction temperature” array. I also want to add a function that clears the array data and new point in graph when the “Clear Array” button is pressed.


You already know how to clear the "measurement data array" (the one based on your random numbers), but now you ask how to clear another array?

What's your problem with applying a known solution from one array to another array???

 

Please keep the discussion in one place! So all people willing to help know the WHOLE story of your VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 23 of 29
(598 Views)

hi. thank you for the reply.
The reason I'm posting this in a new post is to get more help from other experts.  No one else has responded to this post except you,
1. I don’t know how to change the case structure. Should I put it in timeout? Or should I put it in the file path value change?
2. I tried, but I can't implement it in LabView. I tried following other examples but failed.
3. I received two pieces of data and tried to put them into the array I wanted, but it failed. I know how to delete an array.

I know the method you gave me, but I'm having trouble actually putting it into my code.
If you edit my vi directly, I think I can quickly figure out my problem.
As you know, I am a beginner at Labview, so it is very difficult to implement.

thank you!

0 Kudos
Message 24 of 29
(580 Views)

Hi nick,

 


@nickbruk wrote:

1. I don’t know how to change the case structure. Should I put it in timeout? Or should I put it in the file path value change?


I attach your VI with some changes rgarding the file loading and parsing. I also show how to put the graph plot data in a shift register...

 


@nickbruk wrote:

3. I received two pieces of data and tried to put them into the array I wanted, but it failed. I know how to delete an array.


You know how to create your array of random values.

You need to do the same stuff for an array of plot data in order to be able to create another plot of your "when I click a button" data...

 


@nickbruk wrote:

As you know, I am a beginner at Labview, so it is very difficult to implement.


Then you really should use those Training resources at the top of the LabVIEW board to be able to apply the LabVIEW basics to your VI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 25 of 29
(572 Views)

Thank you so much!!!

I understand the case structure.
However, the "refer mean" value, "refer temperature", and “extraction temperature by curve fitting” values immediately disappear.

These values are important in the file (graph) I loaded, how do I resolve this?

0 Kudos
Message 26 of 29
(554 Views)

Hi Nick,

 


@nickbruk wrote:

However, the "refer mean" value, "refer temperature", and “extraction temperature by curve fitting” values immediately disappear.

These values are important in the file (graph) I loaded, how do I resolve this?


I showed you how to store the plot data in a shift register.

Now you really ask how to store the other values so you can see them in each iteration?

 

How often do I need to mention "shift registers" again?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 27 of 29
(548 Views)

Hello,

 

What I'm wondering is, because of the case structure, do I still have to use a shift register to hold all the values?

0 Kudos
Message 28 of 29
(544 Views)
Solution
Accepted by topic author nickbruk

Hi Nick,

 


@nickbruk wrote:

What I'm wondering is, because of the case structure, do I still have to use a shift register to hold all the values?


Are you talking about the EVENT structure?

Regardless of the structure: to hold values for the next iteration(s) of the loop you should use shift registers! (Basic LabVIEW stuff...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 29 of 29
(534 Views)