LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array not updating in a subvi

Dear champions,
 
When user selects a particular input, the array will output 10 values and for another input, it will output 7 values.
The problem is that, on repetitive calling, when selecting second input, array has 7 values + last 3 values outputted by the first call.
 
How to handle this? I used local variables, but no use.
 
Thanks & Regards,
Mathan


Message Edited by mathan on 07-01-2008 12:50 AM
0 Kudos
Message 1 of 8
(3,255 Views)

Hi mathan,

why do you use local variables? Smiley Wink Can you show your code, i don´t fully understand the problem?

Mike

Message 2 of 8
(3,252 Views)

Dear mike,

I can't able to post that code here. Please understand. I will explain bit more in detail.

Actually, the user will select either 1 or 2. If he selects 1, then there will be some output (10 values) in an array. If he selects 2, then there will be some 7 values outputted in the same array.

On continuous calling of this vi in another vi, when the user selects 2, the array holds first 7 values correct, but the last 3 values remains showed (occured during selection of 1) and not cleared.

But in the same vi, it works great. That is for selection of 1, it holds 10 values and selection of 2 will shows 7 values.

Give me a workaround. I tried with initialize array clearing the array at the time of each call. But nope.... Smiley Sad

0 Kudos
Message 3 of 8
(3,248 Views)

Hi mathan,

did you store your data in a shift register? You can use the array subset function. See this picture.

Hope it helps. Mike



Message Edited by MikeS81 on 07-01-2008 08:24 AM
Message 4 of 8
(3,243 Views)

Dear mike,

I am sorry if i was not clear. Still finding difficulties.

In the subvi, i will get these array values case 1: 3B 6D 01 7E 6F 01 80 AB 90 00 and also the length of this array(Here 10). case 2: 3B 6D AB 90 00(Here 7). Both outputs(array and length) are coming from a dll output.

When i called the subvi in another vi, and just displayed the array (using connector panes), the array was not properly displayed as i told in previous posts.

Now i just want, if i have array length and array from a subvi, inside the main vi how to limit the array display with that particular length.

0 Kudos
Message 5 of 8
(3,220 Views)

mathan wrote:
Now i just want, if i have array length and array from a subvi, inside the main vi how to limit the array display with that particular length.

The problem solved. Just used Reshape array function. That did the trick.... Smiley Surprised
 
Thanks, Smiley Wink
Mathan
0 Kudos
Message 6 of 8
(3,214 Views)
Hi Mathan,

IMHO "Array Subset" seems the more logical answer here...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(3,212 Views)

Dear GerdW, Smiley Happy

Yes. Just now checked that option also. Smiley Wink Works very fine. Smiley Surprised

Thanks, Smiley Very Happy

Mathan

0 Kudos
Message 8 of 8
(3,210 Views)