LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read an excel file and convert to a 1-D array of long, 32-bit integer?

Hi Guy,

 

any text editor can create csv files (as they are just simple text...)!

 

Anyway it should work with Excel too, everybody else uses those tool. Save your sheet in Excel as "csv", then close Excel. After that you can open the file in LabVIEW...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 20
(1,391 Views)

"Error 7 occurred at Open File+.vi:Open File"

 

I do appreciate you guys going through stupid things, because I'm pretty sure it's something stupid on my end. The file path is fine, I went into the properties of the file and found it there, so all I had to do was copy and paste that.

0 Kudos
Message 12 of 20
(1,387 Views)

Hi Guy,

 

no need for "Copy&Paste" when you place a path control on the FP and use it's browse button...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 20
(1,382 Views)

Another trick is to drag the file itself into the file path control.

 

Error 7 is specifically that your file does not exist.  You are pointing to the wrong file or only the folder(?).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 20
(1,378 Views)

I've dragged and dropped, I've copy and pasted from the location in properties, I've browsed for path, and they all direct to that same location, so I doubt that I'm pointing to the wrong file. I'm not sure what else I can do to try and fix this.

0 Kudos
Message 15 of 20
(1,374 Views)

Hi Guy,

 

can you open the CSV file with a text editor (Notepad will do...)? If yes, than LabVIEW should be able to open that file too.

 

Maybe a short peek into your VI would make sense? Mind to attach it?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 20
(1,377 Views)

I can open it with notepad.

 

I'll attach it. That column of numbers under the "read from spreadsheet file.vi" is what I was using before, and what's in the csv file that I'm using to test, in case you're wondering.

0 Kudos
Message 17 of 20
(1,369 Views)

Hi Guy,

 

do you really think your RT target has access to your PC's harddrive? Those are two completely different computers.

You should have noted that in the first post!

 

Easy solution: Transfer the csv file to your RT target -  and don't forget to change the path according to your RT target file system...

 

Doh...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 20
(1,367 Views)

As you've probably figured out by now, I'm pretty new to all this, so I didn't think of anything along those lines.

 

Is transfering the csc file to the target as easy as dragging it under the target in the project?

0 Kudos
Message 19 of 20
(1,356 Views)

No.  It's easy to do through Windows.  Run ftp://aaa.bbb.ccc.ddd (replace a.b.c.d with the IP address of your RT target).  Then drag the file to the appropriate directory on the RT target.

0 Kudos
Message 20 of 20
(1,353 Views)