LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to import spreadsheet data into array constant in VI

I want to create a VI with a static array of double precision values. The values represent an ECG waveform. I have the values in an Excel spreadsheet. How do I transfer these values into the static array (array of constants) in LabVIEW? I can not find a simple cut and paste method to accomplish this. Hopefully, there is a simple way that I'm just missing.
0 Kudos
Message 1 of 5
(4,838 Views)
The "simplest" way I have found is a 2 step process.
1) Make a VI to read in the array (could have excel save the file as text).
2) Once the array is read in , Right Click the array and select "Create Constant".
3) Remove all the other code and keep the constant.
Ok it is a 3 or 4 step process. There is no way to do this directly (as far as I know).
Kevin
Message 2 of 5
(4,838 Views)
That should work. Thanks.
0 Kudos
Message 4 of 5
(4,838 Views)
Another way:

1) Make a VI to read in the array & wire that array to an indicator.
(If you want to read in an actual Excel .xls file, look around
zone.ni.com for examples.)

2) Once the array is read in, hold down the ctrl key (in Windows), &
drag the indicator to the diagram.That creates a constant with the same
value as the array. A neat trick!

Mark
Message 5 of 5
(4,838 Views)
You could load your data and feed this to an indicator of array of double precision type.

select and copy your indicator and paste this on to the diagram of your VI. This will create a constant.

If you what this to all happen at runtime, thenyou will have to use a Global or local variable and use this as your constant.

Ray.
Regards
Ray Farmer
Message 3 of 5
(4,838 Views)