LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Import Coordinates from Excel into LabView

Hello everyone,

 

I am trying create a virtual prototype of a 3D Printer where the motors are being controlled via Softmotion in Labview.  I have watched and read a few tutorials to try to get an idea on how control the motors, but they all have inputted a coordinate directly into the "Position" of the "Move" Function Block.

 

I am wondering if there's a module or another way to maybe import a list coordinates from excel and input that into the "Position" section instead.

 

So far I have been thinking of using File I/O >> Read Delimited Spreadsheet.vi, but I am not entirely sure how to go about that.

 

Any input is much appreciated...

 

Zar

0 Kudos
Message 1 of 15
(3,818 Views)

How is your file saved?  If you save your Excel file as a txt or CSV, then you can use the Read Delimited Spreadsheet.vi (txt uses tab and CSV uses a comma as the delimiter).  If you have an xls or xlsx file, you have to jump through hoops via .NET or ActiveX.


GCentral
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 2 of 15
(3,814 Views)

Save your file as .csv and you can read it through the lavbiew read spreadsheet vi. otherwise save as .txt and read via that too!

0 Kudos
Message 3 of 15
(3,790 Views)

Thanks for the quick replies.

 

I was thinking of that, but would it be able to read the rows one by one?  That's essentially my goal...

0 Kudos
Message 4 of 15
(3,785 Views)

You can select which row you want to read/start with using the read delimited spreadsheet vi (: 

 

fee.PNG

0 Kudos
Message 5 of 15
(3,780 Views)

I see.  So I would just refer to the file using "file path" and set the delimiter as "," because it's a .csv file.  Would the output then come from the "first row," in which I could connect to "Position" in the "Move" Function Block that I mentioned before?

0 Kudos
Message 6 of 15
(3,777 Views)

can you upload a pic of your spreadsheet so i can see how it looks? 

 

edit: but it should come out pretty much the same as your spreadsheet im sure...

0 Kudos
Message 7 of 15
(3,769 Views)

SC.png

 

So far I used the Read Delimited Spreadsheet.vi, converted the string into a number and used an Index Array to specify the row and column in excel.  

 

I'm thinking of looping that and make it add a number into the index every time it loops? Not to sure how to go about that, but that's where I'm at and what I'm currently working on.

 

Sorry, I'm fairly new to LabView and I know I might end up asking stupid questions. :s

0 Kudos
Message 8 of 15
(3,758 Views)

Do you mean change the row and column by 1 every time it loops? like this? I am also fairly new to labview so take what i say with a grain of salt lol!

 

jytfjyt.PNG

0 Kudos
Message 9 of 15
(3,749 Views)

or you could just use the index and add that to the value coming out of the shift register or however you want! once again - also new so just throwing ideas out with you

 

0 Kudos
Message 10 of 15
(3,743 Views)