From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-18-2017 09:22 AM
I have searched the LabView Forums as well as done a general search of NI documentation, but can't find anything that directly addresses my problem(s). I am relatively new to LabView, but have been programming on a large LV project for about 7 months now, so I'm not a rank beginner. I have experience in programming in text-based languages, but I get stumped by LabView again and again over things like this, which is very frustrating.
My current issue -- I am reading an external file in spreadsheet format with Read From SpreadSheet File. The first row in the resulting 2D array is the headers for the columns. I need this header row in other contexts (reports, tables), but I don't need the header row for a particular context. I just need the values from the file.
I have tried removing the header row, but Delete from Array at index 0 doesn't seem to work as I expected and the examples of working with 2D arrays on the Forums doesn't address my issue. Or at least I don't see an easy solution based on the threads I read. I tried getting the length of the array before removal, to compare with after, but ran into a new and different issue. I wired up an Array Size to try to get the length of the 2D array, but got an error, even though I followed (I thought) the examples I found in the documentation and even though the Error List says my source and sink have identical datatypes.
My company's policies prevent me from uploading any actual code, but I've provided a PNG snippet of the code where the problem occurs.
Can anyone provide a solution?
Solved! Go to Solution.
05-18-2017 09:41 AM
Quick suggestion. Delete the offending wire. Right click the output of the array size and select 'create indicator'.
05-18-2017 09:47 AM
In preparing the PNG image for the post, I noticed that I had a 0 for input into the Delete From Array. The length of 1 did the trick and removed the first row, as hoped for. Sorry for the post on that topic.
05-18-2017 09:51 AM
I did as you suggested, created the numeric indicator by right-clicking the Array Size icon, but I still get an error on the wire from the Array Size to the Indicator, as before.
As a person trying to understand LabView, why would right-clicking to create the numeric indicator be different from creating a numeric indicator from the Controls palette, if they are the same data types? Why would you suggest this answer as a possible solution?
05-18-2017 09:54 AM - edited 05-18-2017 10:15 AM
Because according to the error message you posted the source is a 1D array(32 bit integer). The sink is just a 32 bit integer.
I'm not sure why the method did not work for you. I use this method all of the time and never had that problem. Much faster than going to the front panel and creating a array container>>then create a numeric indicator>>then change the representation of the numeric indicator to I32>>then drag the numeric indicator into the array container.
05-18-2017 11:04 AM
Array size returns an array if there is more than one dimension.
Also you don't need to delete from array and index array in order to get the headers separate from the data. See below.