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

Hi nick,

 


@nickbruk wrote:

I don't know how to implement the method you mentioned in my vi.


"IF … THEN … ELSE" is just a case structure in LabVIEW.

To dis-/enable a button you need to set a property of that button using a property node.

 

What have you tried and where are you stuck?

Best regards,
GerdW


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

Thanks to you, I solved it well.

I attached the vi file. Also, the txt file loaded next was imported into the graph.

How can I implement the algorithm I attached as a pdf?

I also want to display the line fitting line and matching data points on the graph.

I wish I could keep entering matching dat and get the temperature result. thank you!

Download All
0 Kudos
Message 12 of 29
(455 Views)

Hi nick,

 


@nickbruk wrote:

How can I implement the algorithm I attached as a pdf?


LabVIEW comes with ready-to-use fitting functions, you just use them to get slope+offset.

You can also define the fitting algorithm as you need to set your requirements for that fit (which kind of "best fit" do you need?)

 


@nickbruk wrote:

I also want to display the line fitting line and matching data points on the graph.


The context help for graphs/charts also show how to provide an array of plots...

 


@nickbruk wrote:

I wish I could keep entering matching dat and get the temperature result.


Once you know the slope your problem reduces to simple math!

There is a X difference between "random" and "reference", so you can calc

y-diff := x-diff * slope

Then you can easily get your desired Y value from "random" and "y-diff"...

Best regards,
GerdW


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

thanks a lot!

 

- How to get the x value of a reference point from a text file?

- How do I share random number data between two while loops? I used a property node, but sharing is not possible.

- I want to limit the number of arrays accumulated in the shift register to 6. What method should I use?

0 Kudos
Message 14 of 29
(439 Views)

Hi Nick,

 


@nickbruk wrote:

- How to get the x value of a reference point from a text file?


To plot a point on a XY graph you need to know its X and Y coordinate.

When you know the format of your text file then you just need to read the required value...

 


@nickbruk wrote:

- How do I share random number data between two while loops? I used a property node, but sharing is not possible.


Why do you need two loops?

Anyway: there are a lot of ways to share data between loops, from queues, notifiers, channels, even locals or globals...

 


@nickbruk wrote:

- I want to limit the number of arrays accumulated in the shift register to 6. What method should I use?


To limit the array size you could use functions like ArraySubset.

Or you initialize the array with required number of elements and just replace the elements instead of appending new elements to an empty array...

(This is about basic array handling in LabVIEW: there are Training resources offered at the top of the LabVIEW board!)

Best regards,
GerdW


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

Hi, thanks for your help.

 

But I couldn't solve this problem.

Can you help me specifically?

 

  1. I want to find the row corresponding to the reference point “1” in a text file, and find the x and y values ​​of that row.
  2. I wanted to share random number data between while loops, but it failed. Even if you make it a local variable, it cannot be shared at the same time.
  3. We will address limiting the array size later. I couldn't solve this part either.
  4. I wanted to display the current random data (x) and current temperature I received again on the xy graph, but it failed.

I feel like it's beyond my capabilities.

Can you help me code my vi?

Download All
0 Kudos
Message 16 of 29
(426 Views)
Solution
Accepted by topic author nickbruk

Hi Nick,

 


@nickbruk wrote:

I wanted to share random number data between while loops, but it failed. Even if you make it a local variable, it cannot be shared at the same time.


You don't read that local in your 2nd loop, atleast I don't see where you attempt to read it…

And more importantly: you can only read current values when the 2nd loop is iterating - but you block that iteration by using an event structure set to wait for an event!

 


@nickbruk wrote:

We will address limiting the array size later. I couldn't solve this part either.


You already add elements to an array inside a case structure so you know how to handle arrays conditionally.

What's your problem to place another case structure (with a condition based on array size) to handle the array conditionally?

 


@nickbruk wrote:

I want to find the row corresponding to the reference point “1” in a text file, and find the x and y values ​​of that row.


You read the text file using ReadSpreadsheetFile.

Then you index the 4th column and search for a "1" value.

Using the index you found you can index the corresponding value from your x/y columns…

 


@nickbruk wrote:

I wanted to display the current random data (x) and current temperature I received again on the xy graph, but it failed.


Do you want to display a single point on a XY graph?

The context help of the XY graph shows you how to show plots consisting of X and Y value pairs…

Best regards,
GerdW


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

thank you.
Some problems have been solved, but there are still problems that are not solved.
I'll post a question again.
Thank you for that time!

0 Kudos
Message 18 of 29
(403 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. I used the case structure to input the text file multiple times instead of once, but the while loop does not work. Is there a way to solve this problem without using the case structure?
  2. I want to plot the “input mean” and “input temperature” values I received on the xy graph.
  3. When we press the “matching button” for “input mean” and “extraction temperature”, we want to store them in the “input mena/extraction temperature” array. I also want to add a function that clears the array data when the “Clear Array” button is pressed.

please help me

I'll attach my vi.

thank you!

Download All
0 Kudos
Message 19 of 29
(403 Views)
Solution
Accepted by topic author nickbruk

Hi nick,

 


@nickbruk wrote:
but the while loop does not work. Is there a way to solve this problem without using the case structure?

The while loop "does not work" because your event structure still blocks the iteration by waiting for an event!

 

Remove the wait function inside your loop and create an additional TimeOut event in the event structure. Have the TimeOut event wait for 10ms (the same as your current Wait function)…

Best regards,
GerdW


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