Hi,
I wonder if it is possible to make table with dynamic number of rows.
Normally if I use as 'data array'
_array:ARRAY[0..9]OFINT;
I will have table with 10 rows - always with 10 rows (unless I set 'Max. array index' to lower value)
I want to make it more dynamic. I try:
_array:ARRAY[*]OFINT;//in VAR_IN_OUT declaration of Visualisation_array:POINTERTOINT;//in VAR_IN_OUT declaration of Visualisation
But I alway got only one row. I have tried to set 'Max. array index' to eg. 5,
manually set column template -> 'Text variable' set to '_array[INDEX]'. But it does not work unfortunately.
Do you have any idea if it is possible? Or I can only use constant size tables?
Thanks for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
When I use an Array like yours : Myarray : ARRAY[0..9] OF INT;
And I set 'Max. array index' to 2, I got 4 lines in the table.
You can also :
- use a variable (for example : diIndexAff) as 'Max. array index and It works dynamically.
calulate the value of the variable like this :
VAR
diIndexAff:DINT;
END_VAR
(Max value calculation minus 2)
diIndexAff:=UPPER_BOUND(Myarray,1)-2;
I did not try with the second try (_array : ARRAY[*] OF INT;).
Hoping to help you.
BR.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I wonder if it is possible to make table with dynamic number of rows.
Normally if I use as 'data array'
I will have table with 10 rows - always with 10 rows (unless I set 'Max. array index' to lower value)
I want to make it more dynamic. I try:
But I alway got only one row. I have tried to set 'Max. array index' to eg. 5,
manually set column template -> 'Text variable' set to '_array[INDEX]'. But it does not work unfortunately.
Do you have any idea if it is possible? Or I can only use constant size tables?
Thanks for your help.
Hi,
When I use an Array like yours : Myarray : ARRAY[0..9] OF INT;
And I set 'Max. array index' to 2, I got 4 lines in the table.
You can also :
- use a variable (for example : diIndexAff) as 'Max. array index and It works dynamically.
VAR
diIndexAff:DINT;
END_VAR
(Max value calculation minus 2)
diIndexAff:=UPPER_BOUND(Myarray,1)-2;
I did not try with the second try (_array : ARRAY[*] OF INT;).
Hoping to help you.
BR.