LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert excel file to lvm format

Solved!
Go to solution

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.

0 Kudos
Message 1 of 12
(6,792 Views)

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.

Tim
GHSP
0 Kudos
Message 2 of 12
(6,788 Views)

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,

0 Kudos
Message 3 of 12
(6,781 Views)

Do you have an excel file that you want to open for the data? I did not see that in your attachments.

Tim
GHSP
0 Kudos
Message 4 of 12
(6,777 Views)

Yeah here it is. The first column is time and the second is acceleration.

0 Kudos
Message 5 of 12
(6,770 Views)

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.

Example.png

Tim
GHSP
0 Kudos
Message 6 of 12
(6,765 Views)

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.

Download All
0 Kudos
Message 7 of 12
(6,733 Views)

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

 

0 Kudos
Message 8 of 12
(6,717 Views)

Thanks for replying Bob.

 

So is there a way to write a VI that can give me a 2D array file in lvm format?

0 Kudos
Message 9 of 12
(6,714 Views)

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.

0 Kudos
Message 10 of 12
(6,713 Views)