02-18-2015 04:34 PM
Hello,
I am trying to count the total number of elements in an array.
I have a simulate signal VI, that simulates a square pulse, this is being written into an excel file using the write to measurement VI, all for a given period of time.
I want to further chop a window of the signal depending on different paramenters (a trigger, which I intend to incorperate later, for now I am working of learning how to chop the data)
In order to chop the data I need to know the array size, I use the array size funtion, I right click on the appeneded array in the front pannel and click show last element (array size -1) it doesnt match with the number of rows in the excel file written by the write to measurement VI, in fact it macthes with the "number of samples" I selected in the simulate signal VI.
Am I doing something wrong?
Why is there a miss match??
I have attached my VI, Please help
Thank You
SP
02-18-2015 04:39 PM
That's the problem with using the dynamic datatype (blue wire). It makes it easy to connect stuff together, but it hides the underlying data in a way that you really don't know what is going on.
The reason you have a size of one is that you are building your single DynamicDatatype into a 1-D array (with only 1 element) of Dynamic Datatypes. The information you really want is hidden in that original blue wire.
You need to use the Express VI palette to convert that original blue wire into another data type. There is a VI called "From DDT". Configure it to give you something else such as a 1-D array of doubles.
02-18-2015 05:12 PM
Hello RavensFan
Thank you for the reply, I did incorperate the changes, but the same number is displayed in the indicator. I've attahced my VI
SP
02-18-2015 06:50 PM
You didn't get rid of the build array function. So it turned your 1-D array of 1000 elements into a 2-D array of 1 x 1000 elements. Which is why your array size function gives you an array of 1 and 1000, the size of each of the 2 dimensions.