06-14-2014 09:04 AM
Hello , I'm little new to labview ,need a help urgent
I have a 2D -array with 1 column and 1000 rows my output type is also a 2D-array, i'm trying to converting all the values here, for example if all my input 2d array values are 200 , i will divide it by 500, so all my ouput array should contain 0.4 ,
but in the output array only the first value is changing to 0.4 and remaining are 200.
I have attached the my VI here CommandFSConversion.vi which is having the sub vi(FSconversionCommand.vi)
06-14-2014 10:32 AM
In the subVI, you are indexing out the first row instead of the first column. Wire a zero to the lower index instead.
However, the entire toplevel code seems incorrect. if the input array really only has one column, there is no way to replace any highrer numbered columns, because they don't exist. Don't duplicate all this code depending on the array size. Just autoindex in a FOR loop.
06-14-2014 10:37 AM
06-14-2014 10:46 AM - edited 06-14-2014 10:48 AM
@mikeporter wrote:
you don't need a subVI. all you need is the LV divide function. wire your 2D array to the X input, a scalar constant with 500 in it to the Y input and you're done...
Well, he seems to have an array of scale factors so it might e a litttle bit more complicated.
Does the size of the array of clusters correspond to the number of columns? A simple FOR loop, autoindexing over the columns (transpose first!) and multiplying with the scale factor will do everything in one step.
Of course, you seem to do everything on the first column, so maybe you want multiple columns as output, one for each element in the cluster array.
06-14-2014 12:27 PM
Thank You so much sir for your response on my issue,
I tried to follow your solution from the second screenshot which you have provided but could not execute it exactly i'm getting conversion error after Transpose array. then i tried to add dimension to it but got error related to dimensions in my main VI,
Please dont mind if something is wrong from my side.
Attached screenshots
06-14-2014 01:01 PM
Your CMD out is currently a 1D array. Change it to a 2D array.
06-14-2014 01:10 PM
yes that is the problem if i'm trying to make that 2D i'm getting same dimensions problem in my main VI.
i attached both my main vi and subvi in beginning of the post
06-14-2014 01:38 PM
My example does not even use the subVI.
06-14-2014 11:13 PM
Sorry i didnt understand what to do with my first VI FSConversionCommand.vi in which i have a case structure, so do u want me to implement similar kind of for loop with autoindex?
06-15-2014 12:12 AM
You don't need a case structure here.