03-12-2019
03:23 PM
- last edited on
06-10-2025
03:27 PM
by
Content Cleaner
I need some help writing to a spreadsheet. I’m working on the following example https://forums.ni.com/t5/Example-Code/Dorm-Room-Alarm-System-Using-a-PIR-Motion-Detector-Speakers/ta...
for part 8, write to spreadsheet, I can’t get it to work. I add the vi into the loop( it’s the write to delimited spreadsheet vi) but it won’t recognize any file. When I run without a file location and it prompts me to pick a file, nothing is selectable. I end up just closing the screen and getting error 43. Any hep would be appreciated.
03-12-2019 03:55 PM
Hello,
i hope to help you with the pour information that you give us.
I think that you wire a control file path with the property to select a folder. For this reasono you are not able to select a file or write the name of new one. The error 43 is because you didn't select a file (in other words the field is empty).
03-12-2019 04:23 PM - edited 03-12-2019 04:29 PM
Your pdf attachment is broken (file name probably contains reserved characters). It would help to attach your VI instead anyway. try it.
03-12-2019 08:13 PM
attached is my VI. I got it to run but it only returns one value in the .csv file. I'm not sure what's wrong with it.
03-12-2019 10:34 PM - edited 03-12-2019 10:34 PM
03-12-2019 11:12 PM
The data I need recorded is the every time the motion sensor/alarm goes off. It’s fine if it continually writes over the old file, i just need to show it collects the data and exports it to a file, which unfortunately it’s not doing.
03-12-2019
11:15 PM
- last edited on
06-10-2025
03:27 PM
by
Content Cleaner
Here is a link for the actual setup and explanation of how it works. The bottom of that page, section 8, is where it mentions adding the export data function.
03-13-2019 08:19 AM
Well, you slavishly copied the code that NI provided in the example you cited, but when it came to the Export Data section, you chose to "do something else". Here is what it says:
You did not use "Write to Spreadsheet File.vi" Express VI. This is actually a good thing, as Express VIs are often a "crutch" that inhibits learning LabVIEW. But the second sentence, which ends "be sure to append new data to the spreadsheet file", you ignored completely. Right-click the Write Delimited Spreadsheet function you are using, and read the Help. Do you know about Shift Registers? [I think "probably not"]. If not, go find some LabVIEW Tutorials (start at the first page of this Forum and look at Learn LabVIEW Basics).
Bob Schor
03-13-2019 08:48 AM
Bob,
Just to be clear, I by no means 'slavishly' copied this with any attempt to pass it off as my own. My assignment was to complete this example, and by performing it, you will see that in reading the instruction step by step you physically copy the .png file with the block diagram.
The reason I did not use the 'write to spreadsheet.vi' as stated in the instructions is that it's not an option in my version of labview. My system only lists 'Write to delimited spreadsheet'. I did double click to open the settings and checked the box to append the data. If there was something I ignored it's because i'm not sure what to do, hence why i'm on here looking for assistance.
thanks for the "help".
03-13-2019 08:58 AM
The name changed to "Write Delimited Spreadsheet" when NI added the Error Line to this function. You still need to make sure the "Append" input is True on all but the first run, which you can do with a Shift Register (wire a "True" to the right-inside side to turn it True for the "next" iteration).
Bob Schor