09-14-2013 12:46 PM
Hi
Since i am new to Labview i hope i can find some help here.
I am reading values from the tcp server continously in while loop,but i wanted to build an array after i receive 13 values from the server i mean after 13 iterations later i have to bulid 1D array with this values and then add this array to 2D array.can anyone help me how can i do this??
09-14-2013 01:49 PM
09-14-2013 02:46 PM
chadalawada wrote:I am reading values from the tcp server continously in while loop,but i wanted to build an array after i receive 13 values from the server i mean after 13 iterations later i have to bulid 1D array with this values and then add this array to 2D array.can anyone help me how can i do this??
You need to be much more specific in the description. It is typically easiest to add a small VI showing the problem, so please do so!
I assume you start building the array of 13 vaules when you receive the first element and not after 13 iterations. (where would you keep the historc values?)
The sentence "add this array to 2D array" is very ambiguous. Since the dimensions don't match, it is not clear at all. The word "add" typically means an arithmetic operation and will not work if you mix dimensions as you do here. Could it be you mean "append" to a 2D array instead? Does the 2D array have 13 rows or columns? Do you want to append a row or append a column? When will it ever end? If you do this forever, you will run out of memory.
Please explain!
09-14-2013 03:01 PM - edited 09-14-2013 03:02 PM
Let's assume you want to collect 13 values in a 1D array, then apend it as a new row to a 2D array. Here's one simple way to do it.
09-14-2013 03:15 PM - edited 09-14-2013 03:15 PM
Of course since the 1D array is of fixed size, it would be more efficient to operate on it in place, e.g. as follows:
09-15-2013 09:03 AM - edited 09-15-2013 09:03 AM
Thank you very much altenbach,It is exactly what i wanted thank you very much.
09-15-2013 09:23 AM
Can i add time and date stamp to each and every row??
09-15-2013 10:42 AM
@chadalawada wrote:
Can i add time and date stamp to each and every row??
Yes, of course! That would be a trivial change, have you tried?
Do you want the time stamp of the first element or of the last element in each row?
09-15-2013 11:35 AM
Yes i have tried to buid another Array from from 1D array,but i am unablw to add string Data and time to this 1D array.I want to add Date at first column and time in second column for every row.
09-15-2013 12:38 PM
Well, you cannot mix datatypes in an array, so if precision does not matter, you could build a string array and format the various fields according to the data.