06-12-2025 12:51 AM
I want to write the data displayed in LabVIEW into a spreadsheet.
However, I could not save the data due to an error.
I want to save the data written to the spreadsheet as a csv file.
Below is the error message.
-----------------------------------------------------------------
LabVIEW (Hex0×7)
File not found. The file may be in a different location or may have been deleted. Use a command prompt or file explorer to verify that the path is correct.
-----------------------------------------------------------------
Attached is the program for the relevant area.
Solved! Go to Solution.
06-12-2025 01:36 AM
Nobody in his right mind will touch your code, but let's focus on the spreadsheet write.
You open and close a file, but you never wire a path to the file write function.
You should also NEVER operate on entire paths as string
Format date/time assumes current time, no need to wire a timestamp
The way you process the time string is dangerous, because it trims leading zeroes from the month. This makes it ambiguous for many dates.
Here's a working alternative
06-12-2025 03:59 AM
Hi ikeda,
@ikeda_kaoru wrote:
LabVIEW (Hex0×7)
File not found. The file may be in a different location or may have been deleted. Use a command prompt or file explorer to verify that the path is correct.
In addition to Christians comment:
The default operation mode of the FileOpen function is to (just) "open" a file. There are other modes like "Create or open" when you want to create a file on first file access…
(Or to put it short: read the help for each function you use! 😄 )
06-12-2025 09:07 AM - edited 06-12-2025 09:15 AM
If yo look inside "write delimited spreadsheet" (yes, it is just a plain VI where you can look at the code!), you can see that it already does various tests and opens/cluses the file. All it needs is a path! In your case it should have given a file dialog popup, which you should have seen.
However, Gerd's point is important, because your VI uses "file open" quite excessively in other parts (there are 10(!!!) instances scattered all over that gigantic diagram!!) and some seem to have unicode(?) file names hardwired. All file names seems to be base on time and thus always new.
This program is such a hairball that it should be tossed and rewritten as a simple state machine that fits on one screen. There is no way to reasonably debug this, because I can only see <10% of the code at any given time. Here's how the navigation window looks like! There is way too much convoluted and duplicate code! There is a lot of code smell!
06-19-2025 09:29 PM
@altenbach さんは書きました:
Nobody in his right mind will touch your code, but let's focus on the spreadsheet write.
You open and close a file, but you never wire a path to the file write function.
You should also NEVER operate on entire paths as string
Format date/time assumes current time, no need to wire a timestamp
The way you process the time string is dangerous, because it trims leading zeroes from the month. This makes it ambiguous for many dates.
Here's a working alternative
Thank you for your reply.
I was able to modify the program you attached and save the CSV file.
The data in the file was also correct.
Thank you very much.
06-19-2025 09:33 PM
Hi GerdW,
@GerdW さんは書きました:
Hi ikeda,
@ikeda_kaoru wrote:
LabVIEW (Hex0×7)
File not found. The file may be in a different location or may have been deleted. Use a command prompt or file explorer to verify that the path is correct.In addition to Christians comment:
The default operation mode of the FileOpen function is to (just) "open" a file. There are other modes like "Create or open" when you want to create a file on first file access…
(Or to put it short: read the help for each function you use! 😄 )
I used your help and advice and modified the program and the save worked.
Thank you very much!
Best regards,
ikeda
06-19-2025 09:38 PM
@altenbach さんは書きました:
If yo look inside "write delimited spreadsheet" (yes, it is just a plain VI where you can look at the code!), you can see that it already does various tests and opens/cluses the file. All it needs is a path! In your case it should have given a file dialog popup, which you should have seen.
However, Gerd's point is important, because your VI uses "file open" quite excessively in other parts (there are 10(!!!) instances scattered all over that gigantic diagram!!) and some seem to have unicode(?) file names hardwired. All file names seems to be base on time and thus always new.
This program is such a hairball that it should be tossed and rewritten as a simple state machine that fits on one screen. There is no way to reasonably debug this, because I can only see <10% of the code at any given time. Here's how the navigation window looks like! There is way too much convoluted and duplicate code! There is a lot of code smell!
Thank you for your reply.
I apologize for the complexity of the program, which is difficult to see.
I will try to think of a way to make the program simple enough to fit on one screen, so that the complicated parts can be summarized.
Thank you very much.