LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is neccesary to initialize an array of indicators to be able to show my results?

I am working using Labview 7, and I have a problem when I have to show my results in an boolean indicators array.
The problem is that I have to initialize the array to see the results.
Is it normal or am I doing something wrong?Has it any solution?

Thanks in advanced.


Graci
0 Kudos
Message 1 of 11
(3,504 Views)
No it's not normal.

Look at this exemple. Make it run continiously.

If you reverse your array, you must resize to correct size.
0 Kudos
Message 2 of 11
(3,503 Views)
Could you explain what you mean by "Initialize the array"?

Maybe you could attach an example.
0 Kudos
Message 3 of 11
(3,502 Views)
Hi BBLab!

I have seen your example.
And you can see my problem is this example, in the second array you only have initialized 8 positions in the array (you use 8 bits, and you have written a value in the first eight positions). If after doing that, you try writting a value in the position 12 of the array2, it is not posible , you have to initialize at least 13 positions to be able to write a value in the position 12! This is my problem , I have to write a default value in my indicator array, but I don´t know how many positions I have, so, how many values do I have to write?
And if the only solution is writting a default value in the array I have other problem. I have to write these default values the first time that I execute this vi,a posible
solution is using the function "First Call" but I need a while loop, and I can´t use a while loop because this loop would stop my data flow and it is not possible in my application and using global variables is not an option for me!!
What can I do?

thanks for your help!

Graci
0 Kudos
Message 4 of 11
(3,502 Views)
Hi!
"Initilize an array" is that you have to write a default value. And if you don´t have written this default value you can´t write a value in this array indicator. I send an example, Exemple_Array_bool_mod, where you can see this!

thanks!!
0 Kudos
Message 5 of 11
(3,502 Views)
As your example shows with the indicators Array and Array2, you don't have to initialize an array to write to it. If, however, you use the Replace Array Subset, there has to be something in the array to replace before you actually replace it.
0 Kudos
Message 6 of 11
(3,502 Views)
Thank you!!
So, the problem is the function that I am using!!
If I want to write a value in an array, and before doing this I don't want to write a default value. What function can I use? I know that Insert Into array doesn't work properly in my application!

Thanks in advance!

Graci
0 Kudos
Message 7 of 11
(3,502 Views)
You could possibly use the Reshap Array function. In the example, if you first Reshape the Array and use 13 as the dimension size, then your Replace Array Suobset function would work correctly.
0 Kudos
Message 8 of 11
(3,502 Views)
I do not understand why you convert the number to U8, leaving you only 8 elements for the resulting array if you later want to replace element #12.

Whay don't you just remove the "to U8" node, and you'll have 32 booleans in the resulting array to fiddle with. It does not make much sense to create an arbitrary length boolean array from an unsigned integer input with defined width. (If you only need 16 booleans in the array, replace it with "To U16").
0 Kudos
Message 9 of 11
(3,501 Views)
Thank you!!

It works properly!!

Thank you, thank you, thank you!

Graci
0 Kudos
Message 10 of 11
(3,501 Views)