09-25-2008 02:18 AM
Hi
I would like to use an array of values as indicator and as well as controller how do I do the same in labview?
To explain the problem:
There is a while loop running continously and the while loop has two for loops to generate a two dimensional array of values.
So during every iteration of the while loop the array is rgenerated.
But I want to store the first two dimensal array (ie during the first iteration of the while loop) for further calculations with the newly generated array.
How can the same be done?
regards
Sivanand Soamsundaram
09-25-2008 06:14 AM
Use Shift registers
Look at attached VI
09-25-2008 06:20 AM
Can you please save it as labview version 8 .Because I dont have access to labview 8.5.
thanks
09-25-2008 06:40 AM
09-25-2008 07:01 AM
Thanks for the file.
But I want the first array to be stored permanently for accessing in all future iterations.
09-25-2008 10:28 PM
Hello Siva,
From your last statement, you would like to keep the first 2 dimensional array all the way.
You can do so by combining shift register and build an array. The 2 dimensional array from the 2 for loop can be inserted to a 3 dimensional array using build array and then pass the output (3 dimensional array) to a shift register so in the next iteration, a new 2 dimensional array will continue to be added to the 3 dimensional array.
This way, at the end of the while loop, you would have all the 2 dimensional array created from the for loop.
Let me know if you need additional help.
Regards,
James Gerung
NI Application Engineer, ASEAN
09-26-2008 01:49 AM
Thanks for the information.
1.But why is an array constant being used in the left of the main while loop shift register?what should be its value?
2.Also I tried to use the same concept and then after storing all the two dimensional arrays I tried to modify each subsequent two dimensional arrays using the first two dimensional array.as shown in the attached picture .
It works but the problem is the memeory constraint.Because I do not need all the subsequent arrays to be stored I only want the first array to be stored and manipulate the subsequent arrays based on the first array and display the modified array.
3.Also what is the maximum storage that is possible in labview programs and what is the restriction based on?
09-29-2008 03:54 AM
Hell Siva,
In regards on your question:
Q1. The array constant on the left of the while loop is a declaration value. In the case, the value of it is [0,0,0].
Q2. I understand what you mean now. I'll give you couple option on how you can create this.
1. What you can do is to put a conditional case statement with the condition be the while loop iteration is equal to 0. When the condition is true (first array creation), you update the shift register and when the condition is false, you just passed the value of the previous iteration back.
This way, you can keep the value of the first array created when the loop continues to run.
2. You can create the first array outside of the while loop and pass the value into the while loop. You can use value in the input tunnel (contains the value of the array) and manipulate the subsequent array.
Q3. In term of maximum storage, LabVIEW can uses save data to file and the limit would be the size of the HDD in the system.
Please let me know if you have any additional question.
Regards,
James G
Application Engineer, ASEAN