01-30-2025 04:18 AM - edited 01-30-2025 04:19 AM
Hi,
I have an issue in my current labview program. I want to log the elapsed time, however when I log it, it is not continuously increasing. It decreases some of the times, even though the display in the front panel shows the correct time. Any ideas? Can i log the time another way? Additionally, the time starts, as i run the program, but as I am saving the data first, the time does not start at 0. Can I change that, so that it either logs while i'm saving or starts at 0 after saving?
I am not near the thermocouples right now, so that's why it has a random generator.
I also have another issue with the headers of the data, as i cannot seem to "transpose" them into columns instead of rows - however this is secondary, as it can be fixed in excel afterwards. But it would be nice, if it worked from Labview.
Solved! Go to Solution.
01-30-2025 08:01 AM
Okay, i will just answer myself and ask a new question.
I see what the mistake is now, but i don't know how to fix it.
It seems as if I am building arrays, and each time I am adding a new value, it sends all the value to the file. I just want it to send the latest value, so that I don't have huge amount of data stored in the arrays.
Are there another way to store the values or send it to the measurement file? 🙂
Thanks.
01-30-2025 08:05 AM
Hi cha,
@cha_au wrote:
it is not continuously increasing. It decreases some of the times, even though the display in the front panel shows the correct time. Any ideas?
The elapsed time works as expected…
It's the way you save those data! In each iteration you write ALL collected data again and again to your file - instead of saving just the data of the current iteration…
@cha_au wrote:
I also have another issue with the headers of the data, as i cannot seem to "transpose" them into columns instead of rows - however this is secondary, as it can be fixed in excel afterwards. But it would be nice, if it worked from Labview.
You cannot transpose a 1d array: a vector is a vector!
I see two options:
On your images: why did you downscale those images? Now both are hard to decipher…
01-30-2025 12:36 PM - edited 01-30-2025 12:37 PM
@GerdW wrote:
You cannot transpose a 1d array: a vector is a vector!
Some people come from Matlab where a "column vector" != "row vector". 😄
To the OP, you are still way overcomplicating your code despite my guidance from days ago. All you need is a shift register with a single 2D array where you append a row if you really need to graph all data forever, eventually running out of memory. (To only see the last N points, use a chart!).
Appending an ever-growing 2D array to a file is just plain silly, The file size will more than double with each iteration and contain mostly redundant data! All you need to append is one row.
01-31-2025 01:27 AM
Hi altenbach,
I tried incorporating the things you said, but I agree, that it is really complicated, but i am still not sure how to fix it. I put the save file inside the loop, which also works, but as you say, I keep saving huge amounts of data, that I don't want.
I see your point with the graph, so I will definitely use a chart instead. I saw some people using the chart for saving only the last data as well?
How do i append only one row? (chart?)
How do I only use one shift register? Just from the appended array?
Sorry for all the questions, I really appreciate your answers.
01-31-2025 03:09 AM
To chart the data and save the current row, you don't need a shift register, but here's how appending a row to a 2D array would work.
Below you can see how to chart the data and append the time and data as a new row to the file.
Since you know the loop time, you should set the dt of the chart accordingly once before the loop.
You need to start over with the basic tutorials!
02-03-2025 06:06 AM
Thanks, it works now and is so much more clean.