LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert 1D array to four individual numbers

I am using a simple AI read to measure the output of 4 LVDT's. I wish to break up this data (which is in a 4-element 1D array) into four numeric single point precision elements. Any suggestions?? I have tried using the index array function but this still produces an array at the output.
0 Kudos
Message 1 of 4
(2,976 Views)
Hi gordon,

I think you use "AI Sample Channels.vi" which will give an 1D-array. If I connect "Index Array" it works. If you use "AI Read.vi" it will give you a 2D-array, so "Index Array" will give a 1D-array.

Mayby you have done something else wrong it is a good idea to attach the VI to a reply.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 4
(2,976 Views)
Your data from the AI read is not a 1D array with 4 elements. It is a 2D array with 4 1D arrays representing a single channel scan with multiple measurements. To get a single numeric representation. Index the array as you've done and then process each channel. Do soemthing like take the mean of each channel or any other post processing you feel appropriate.
0 Kudos
Message 3 of 4
(2,976 Views)
I should also add that Arrays in LabVIEW can be confusing at first. If you look at the wire thickness you can tell its dimension. Take a look at this picture and you will see (DBL) wire types in LabVIEW. /Mikael
0 Kudos
Message 4 of 4
(2,976 Views)