LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating tables value

Solved!
Go to solution

I'm having troubles updating a two columns table:

 

michelesantucci_1-1732802731912.png

step table control is passed to this VI and updated within the for loop.

If I step trought the loop I can see values updated but as long as the loop terminate the resulting values are un-modified.

I'm missing something?

Best regards,

 Mike

0 Kudos
Message 1 of 7
(514 Views)

Hi Michele,

 


@michele.santucci wrote:

If I step trought the loop I can see values updated but as long as the loop terminate the resulting values are un-modified.

I'm missing something?


I guess you miss to "THINK DATAFLOW!"…

 

As long as the FOR loop iterates the data of the "step table" array is kept in the shift register. Once the loop finishes the control gets new data by writing them into the local variable.

 


@michele.santucci wrote:

I'm having troubles updating a two columns table:


What is your "trouble"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(503 Views)

I need to update the values of the control with the data updated within the for-loop.

Probably I have not understood how for loop and shift registers works but I just took a working code and changed the type of the input field.

0 Kudos
Message 3 of 7
(492 Views)

Hi Michele,

 


@michele.santucci wrote:

I need to update the values of the control with the data updated within the for-loop.


So you need to "THINK DATAFLOW!" again!

 

Where do you need to place this local variable when you want to update the control WITHIN THE LOOP???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(485 Views)

Given your suggestion I think I will have to move the table update inside the loop.
Anyway.. what I'm doing is trying to generalize a piece of code I inherited, this:

michelesantucci_0-1732807589227.png

That was working...

 

Message 5 of 7
(475 Views)
Solution
Accepted by michele.santucci

I guess you want to update the table in the calling vi?

Then you need to pass it by reference - as in the example code - not by value.  If you pass only the value to the subvi, the original control will remain unchanged.

Alternatively, you may pass the new value back to the calling vi (via an indicator) and update the table.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 6 of 7
(454 Views)

I got this.. 

0 Kudos
Message 7 of 7
(451 Views)