07-02-2013 11:49 PM
Hello everyone!
I was doing a simple practic, it's about a random 3D array and the problem is that I cannot use properly the tool index in realtime with random numbers.
Here you have two VI, the first one is simple, it's an 3D array, but if you want you can change de rows, or columns and you will see the element changing for the same 3D array.
But in the second one is the problem, here it is another 3D array, but it is filled with random numbers, and when the filling finish it start over again and again instead I can see all the elemnts of the original 3D array.
How could I do that the original random array stays until I want to generate the next one, and before I generate the next one I can se all the elemnts by changig the numeric controls (pages, rows and coulmns)??
Solved! Go to Solution.
07-03-2013 12:14 AM
Hello Weegee,
Use shift register in your code............
07-03-2013 12:25 AM - edited 07-03-2013 12:28 AM
Your VI is executing once and then stopping. If you want it to keep updating as you choose different index values then you need to wrap that part in a while loop with a stop condition.
When you want to generate another set of random numbers hit the stop button, then run the VI again.
I suggest you start by reading through some online tutorials about LabVIEW programming. They should teach you the basics.
Start here: http://www.ni.com/gettingstarted/labviewbasics/
07-04-2013 09:36 PM
Hello Troy!!!
I'm sorry for the delay but.... I was gettin the labview 2012 in order to analyze your VI, so now...
It works! and it is exactly that I wanted.... but how it works?
Because I already had used a while loop but not that "event structure"
Could you explain me how it works?
07-04-2013 09:59 PM
To work the way you want it to, the number generator must execute once and then the while loop must execute every time you change an index value.
The event structure is set to trigger on a change event from any of the index values.
Writing to the property node for the "page" index using the Val(sgnl) option triggers an initial change event.
I added it once outside the loop as a simple way to get the change event to fire once at the start.
01-25-2014 05:03 AM
01-25-2014 07:04 AM - edited 01-25-2014 07:41 AM
@HussainChachuliya wrote:
in a 1-D array of 7 numbers say 1,2,3,4,5,6 and 7... if i want to change the color of one particular element only...say 1 should be in red color and remaining 6 numbers be in green color...how to do that??
Array elements can only differ in value, not in properties (such as color).
You could use an array of clusters, where each cluster contains a numeric with transparent background over a colorbox. Or (if the array is realtively small and of fixed size), you could convert your array to a cluster of numerics for display. You can get an array of references for the cluster elements and then color each as needed using a FOR loop (font color, background color, etc.). Easiest would be to use a table indicator. Here you can color any cell as desired.
01-25-2014 08:14 AM
01-25-2014 01:01 PM
For a simple example of using a table, have a look here. (Resize the table for a single row or column in your case).
I think this would be the preferred solution.
01-25-2014 02:31 PM