06-17-2021 03:54 AM
Hello,
I am facing a very strange problem. I have a 2D array of doubles (I put an indicator just to make sure I really have this, and I see a 2D array of 3 columns and 2 rows, which is fine), that I link to a "Write Delimited Spreadsheet (DBL).vi" node, as 2D array entry. The code runs fine, no error is returned, however it saves a 1D array with default values (that are saved in the Write Delimited Spreadsheet (DBL).vi file). It is as if there was no input to that subvi, i.e. as if I had not linked the 2D array.
When I double click on that subvi and I execute the code, I can see that the 2D arrays is passed into the subvi. However it saves the 1D default array instead of the 2D array that just entered. I do not understand why it is the case and how to fix this problem. Any pointer is appreciated.
Solved! Go to Solution.
06-17-2021 03:59 AM
Hi bug,
@unspotted_bug wrote:
The code runs fine, no error is returned, however it saves a 1D array with default values (that are saved in the Write Delimited Spreadsheet (DBL).vi file). It is as if there was no input to that subvi, i.e. as if I had not linked the 2D array.
When I double click on that subvi and I execute the code, I can see that the 2D arrays is passed into the subvi. However it saves the 1D default array instead of the 2D array that just entered. I do not understand why it is the case and how to fix this problem. Any pointer is appreciated.
Do you mind to attach some (real) code, which demonstrates that erranous behaviour?
With our LabVIEW installations we cannot observe that problem…
Btw. also mention other information like LabVIEW version (year, bitness), code target (Windows, RT, which RT exactly)…
06-17-2021 04:23 AM
OK, I have just made a minimal working example displaying this behavior. I attach both this MWE file and the Write Delimited Spreadsheet file.
LabView 2018 version 18.0.1 (64 bits), Windows 10 OS.
06-17-2021 04:32 AM
06-17-2021 04:52 AM
Yes I did, I apparently saved some 1D array in there at some point. I have removed every element, one by one, of that array, and now the code works.
So, this makes me think that one should usually never modify the provided vi files of the LabView installation. Unless, of course, one knows what he's doing. I didn't know about that, it should probably be mentionned (if it isn't already) in some noobs mistakes/bad practices.
Thanks a lot, problem solved.
06-17-2021 05:25 AM
Hi bug,
@unspotted_bug wrote:
Yes I did, I apparently saved some 1D array in there at some point. I have removed every element, one by one, of that array, and now the code works.
however it saves a 1D array with default values (that are saved in the Write Delimited Spreadsheet (DBL).vi file).
Well, when you debugged your VI you should have seen this behaviour of the WriteDelimitedSpreadsheet VI! That's the way it distinguishes between 1D and 2D data inputs!
@unspotted_bug wrote:
one should usually never modify the provided vi files of the LabView installation. Unless, of course, one knows what he's doing.
When you have the need to edit any of the vendor-supplied functions you should NEVER edit them directly.
Always create a copy of that function in your own libraries and edit that copy!
(This not only applies to LabVIEW, but to any programming environment…)