LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI of the Day (9/8/2009) - Write to Speadsheet File.vi

By popular demand, the function/VI/control name has been added to the title.  The VI for today is "Write to Spreadsheet File.vi".  This is another classic one that is widely used and abused.  It provides a very important functionality, but if you are a little adventurous you can do a lot better.

 

Really useful context help.  Slightly better detailed help, until you notice it gives you the same detailed help for the different instances.

 

I really suggest you save a copy of this guy and build your own.  I replace the one that ships, but officially that is probably frowned upon, so be sure to save a copy first.Smiley Wink

 

Things that I tweak include the annoying default error handling, adding a string array for column labels, and different versions for different data types.  Sometimes I am very careful to keep everything SGL and then at the final step, bang, this guy coerces it to DBL.  Once you get under the hood, you will see this is a pretty straightforward VI, ripe for improvements.

 

One final note:  This VI writes text files which are very easily opened in Excel, it does NOT write Excel files.  Many forum questions spend about three iterations clearing this up.

 

Groundrules for VIOTD here.

Message 1 of 5
(3,599 Views)

Darin.K wrote:

.....This VI writes text files which are very easily opened in Excel, it does NOT write Excel files.....


Yep. Perhaps they should have named it Write to Delimited File.vi

Richard






Message 2 of 5
(3,586 Views)

Darin.K wrote:

By popular demand, the function/VI/control name has been added to the title.  The VI for today is "Write to Spreadsheet File.vi".  This is another classic one that is widely used and abused.  It provides a very important functionality, but if you are a little adventurous you can do a lot better.

 

Really useful context help.  Slightly better detailed help, until you notice it gives you the same detailed help for the different instances.

 

I really suggest you save a copy of this guy and build your own.  I replace the one that ships, but officially that is probably frowned upon, so be sure to save a copy first.Smiley Wink

 

Things that I tweak include the annoying default error handling, adding a string array for column labels, and different versions for different data types.  Sometimes I am very careful to keep everything SGL and then at the final step, bang, this guy coerces it to DBL.  Once you get under the hood, you will see this is a pretty straightforward VI, ripe for improvements.

 

One final note:  This VI writes text files which are very easily opened in Excel, it does NOT write Excel files.  Many forum questions spend about three iterations clearing this up.

 

Groundrules for VIOTD here.


 

Yes, that is my list of frequently used and modified VIs.

 

For the Noobs:

 

Many of the VIs you find that ship with LV and have an open diagram are OK to modify IF you first save the VI off as a new name outside of Vi.lib. Failure to do this first could put you in danger of loosing your work if LV is upgraded or repaired.

 

End of public service meassge.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 5
(3,580 Views)
Not to be confused with this variation. Be careful what you are spreading.  😮
Message 4 of 5
(3,544 Views)

Nice one (Darins annotations). If you are a professional in LV, start with modifying this one for a resusable lib, suited to your needs/standards. Even they are revised since my good old LV7.1.

 

Felix

0 Kudos
Message 5 of 5
(3,530 Views)