06-30-2015 03:30 AM
Hello,
Can we create a 2d array (360x2) such that each element is added at specified index.Right now, I am using replace array subset which needs already existing array which needs to be initialised but I dont want to do that. Can u suggest me a best method to do so?
* I am using for loop for adding elements in replace array subset .....N=360, 'i' connected to both indices of rows and 0&1 to indices of columns.
06-30-2015 03:59 AM
Hi,
I'm not sure I understood correctly, but do you know the auto indexing function? That should solve your problem. You can use a for loop inside another for loop to build a 2D array.
In general it is a good idea to initialize the array before as it's more performant normally.
Can you post an example of what you try to do or what you have already done?
06-30-2015 04:16 AM
Hello,
I was trying to convert a cartesian to polar and save it in a tdms file.
06-30-2015 04:26 AM
OK, so I'm going to start with the important things:
Why do you use a local variable here, when you could just connect everything that is now a variable?
The first for loop seems obsolete to me.
Aaaand, back to your original problem: you're not updating the array. You load the File fresh every iteration, read 2 values from it, insert them into the (very old) system numeric array 2 and write all of that into a tdms file. What you get is a tdms file that is 360 times as big as you originally intended and has 360 datasets with 1 updated row in it. As I suggested befor: Auto indexing is your friend:
Load the file once, pass the array to a for loop, in it convert, as you've already done, pass it out of the for loop (again, enabling auto indexing) and pass the result to the tdms function. If that doesn't work transpose the 2D array before and after. (not sure about the orientation you get from the file)
Other than that I hope you know that there's a boatload of free tutorials out there, which you access to get better acquainted with the old lady we call LabVIEW:
3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products
06-30-2015 05:42 AM
Hello,
Actually I don't want to use any array at all.I just want to take a file path (which consists a cartesian data) ,convert it to polar and save in a tdms file.
06-30-2015 06:22 AM