LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search 1D array


Kals wrote: 

I am not able to visualize "empty array" for arrays, "empty path" for paths.

 

Whether the Path datatype is equvalent to string datatype?.


 

 
 An empty array has zero elements. (It is still of a specific type and dimensionality. For example it could be an empty 1D array of strings, or an empty 3D array of DBL, or a 2D array of a complex cluster, etc.)
 
Paths and strings are not the same. Paths are specific to paths in that they automatically adapt to the OS. (Unix, MAC, and windows have quite different path syntax and if you would use strings as paths, you would need to reformat on a new platform).
 
0 Kudos
Message 11 of 13
(564 Views)

In your example you have initialized with the null. How is done?. I am using right click then creating it. it gives null array. it shows [0] also.

 

One more clarification.

 

In the switch case there is a tunnel. If i select"default if unwired" it initializes with null array.

if i want to retain previous values then i have to connect to the null array in the false case? why is it so?

i assume, Instead of connecting null array, it is connected to default which is same as null array.

Please correct me if my assumption is wrong.

 

0 Kudos
Message 12 of 13
(547 Views)

Kals wrote:

In your example you have initialized with the null. How is done?. I am using right click then creating it. it gives null array. it shows [0] also.


 

 
Where do you see [0]? I don't!
It gives an empty array of strings. Note that the visible element is greyed. If you would now enter something in the element, it would turn on and you would have an array with one element. Resize the container to see the difference between an actual element and one that does not exist.
You can make an empty array of strings from scratch by first dropping an empty array container from the palette and then dropping a string constant in it.  
You can also use initialize array using a string element and size 0. Same difference!

Kals wrote: 

In the switch case there is a tunnel. If i select"default if unwired" it initializes with null array.

if i want to retain previous values then i have to connect to the null array in the false case? why is it so?

i assume, Instead of connecting null array, it is connected to default which is same as null array.

Please correct me if my assumption is wrong. 


 

 
You don't need to make any assumptions. Simply wire all possibilities and examine the outcome. 😄
 
Do you know what a shift register does (these things with the triangle on them)? Note that we don't have a plain tunnel, but a shift register here. We are connecting the the shift register, which is initialized with an empty array before the FOR loop runs, but later retains updated values after each iteration. If you use "use default if unwired", you would later feed an empty array into the shift register, dropping all data accumulated so far.
 
These are all very basic LabVIEW features. Have you done any tutorials?
Please attach your actual VI, and maybe we can point out what's wrong. 
 
Attached is a working version (LabVIEW 2009). Modify as needed. 
Message Edited by altenbach on 05-27-2010 07:03 AM
0 Kudos
Message 13 of 13
(524 Views)