01-16-2025 11:20 AM
Hi,
I tried to save data (5 temperatures & 4 pressures) to excel file, but I couldn't. My vi file is attached here. Would you help me by modify the code including data saving part?
Thanks
01-16-2025 12:01 PM
You do not have any saving in your code at all. Have you tried looking in the LabVIEW examples? This is an easy thing to accomplish. Go to the top menu and find examples. This will help move you along for the next time you are having an issue.
01-16-2025 01:57 PM
Some general comments:
Here's how your code could look like:
01-17-2025 02:56 AM
Thanks Knight Of NI.
But the pressure should be multiply by 30 then divided by 10 : P= (measured data * 30)/10.
Thanks
01-17-2025 04:12 AM
Hi alhaheeb,
@alhabeeb wrote:
But the pressure should be multiply by 30 then divided by 10 : P= (measured data * 30)/10.
So you want to multiply by 3 and add an offset of 0!?
01-17-2025 10:27 AM
@alhabeeb wrote:
Thanks Knight Of NI.
But the pressure should be multiply by 30 then divided by 10 : P= (measured data * 30)/10.
Sorry, I did not look too closely and multiplying then dividing is somewhat silly and anti-intuitive, especially if we do the temperatures first. Debugging and validating is important and always needed and we would have found the problem in the next step, of course. Since I don't have your hardware, that's up to you. 😄
Just use Gerd's suggestion above. Trivial!
01-20-2025 03:36 AM
Thanks a lot, the code is much better now.
Back to my question about data saving.
I used "write delimited" as shown in the attached file, but when I wire the date to 2D, I have a broken wire (different data type connection). When I wire them to 1D, it shows no error, but I don't have pop up the saving window when I stop measuring!
01-20-2025 10:16 AM
You only have a 1D array because onyl the last measure value will be in the output tunnel and saving will not staurt until the while loop stops (and if you abort the VI, all data will be lost!)
What exactly do you want to save? All data? Just the last reading?
If you want to save all data as it is acquired, open the file before the loop, append a new row with each iteration, and close the file when the loop ends.
Your stop button still has no label! to hide the label on the front panel, change the visibility (right-click...visible items), not change it to an empty string!
01-21-2025 01:54 AM
Yes, I want to save data as it is acquired every 5 min for example.
01-21-2025 02:19 AM
What is the loop rate? So you only want to save a row every five minutes? Just place the save operation in a case structure that activate every five minutes.
Here's a quick skeleton to save as I already described earlier. All you need to add is the conditional saving based on elapsed time.