02-14-2024 01:24 AM
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?
02-14-2024 03:12 AM
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!
02-14-2024 03:25 AM
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"...
02-14-2024 05:14 AM - edited 02-14-2024 05:41 AM
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?
02-14-2024 07:18 AM
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!)
02-14-2024 09:13 PM - edited 02-14-2024 09:14 PM
Hi, thanks for your help.
But I couldn't solve this problem.
Can you help me specifically?
I feel like it's beyond my capabilities.
Can you help me code my vi?
02-15-2024 12:41 AM
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…
02-15-2024 05:15 AM
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!
02-15-2024 05:47 AM - edited 02-15-2024 05:49 AM
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.
please help me
I'll attach my vi.
thank you!
02-15-2024 06:07 AM
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)…