04-25-2017 06:57 PM
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
04-25-2017 07:02 PM
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.
04-25-2017 07:40 PM
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!
04-25-2017 07:44 PM - edited 04-25-2017 07:45 PM
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...
04-25-2017 07:48 PM
You can select which row you want to read/start with using the read delimited spreadsheet vi (:
04-25-2017 08:00 PM
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?
04-25-2017 08:07 PM - edited 04-25-2017 08:08 PM
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...
04-25-2017 08:47 PM
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
04-25-2017 09:36 PM
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!
04-25-2017 09:44 PM - edited 04-25-2017 09:45 PM
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