09-07-2016 01:13 PM
Hi everyone, I'm trying to use the "simulate arbitriry signal" function to simulate a ground motion. When I define signal here, it can only read lvm format file. I wondered if there's anyway I can convert an excel file or txt file into lvm format so that I can use this function?
Thank you very much for the help.
Solved! Go to Solution.
09-07-2016 01:17 PM
First if you attach your code it would be easier to help. Second it is easy to read an excel file and import it into your program. There are examples that will show you how to do this.
09-07-2016 01:23 PM
Hi Tim, thanks for your reply. I'm fairly new to Labview so sorry if there are simple mistakes.
I'm trying to use the attached vi to input a groundmotion so that I can simulate an earthquake using a shake table. However the function I'm using, "simulate arbitrary signal express vi", only read lvm file.
Thanks again,
09-07-2016 01:25 PM
Do you have an excel file that you want to open for the data? I did not see that in your attachments.
09-07-2016 01:29 PM
Yeah here it is. The first column is time and the second is acceleration.
09-07-2016 01:39 PM
Here is how you read the file. You have to set up the delimiter to comma. Once you have that you can read the file. From there you will need to set up the waveform and send it to the DAQ Assistant.
09-07-2016 03:19 PM
I was trying to generate the signal from the data but failed. So I went back to trying to use the simulate arbitrary signal function. I wrote a vi that's suppose to convert the excel file to a lvm file. And attached is the generated lvm file that seems wrong. Can you help me to look at the read_signal vi? Thanks a lot.
09-07-2016 05:14 PM
Excel is a Microsoft Office product that writes "Excel Files", files in a somewhat proprietary format that have the extension .xls or .xlsx. You are dealing with a "comma-separated variable", or .csv, file that (again, by "default") Microsoft uses Excel to open and edit, but it is not an Excel file, but rather a 2D array of (usually numeric) data separated by a character, usually a comma.
I don't particularly like Express VIs, and I like Dynamic Wires even less. Who knows what your code does?
Bob Schor
09-07-2016 05:56 PM
Thanks for replying Bob.
So is there a way to write a VI that can give me a 2D array file in lvm format?
09-07-2016 06:10 PM
Is the attached file what you meant? Now the excel file I'm reading is just one column of acceleration data that I want to use. Then I set dt equals to 0.005.
Again, thank you for your help.