Posted 20 Apr 2018 (edited) Hello, Maybe somebody know how make all array make zero. My array is DATAS: ARRAY[1..15, 1..6] OF INT; I tried it But it don't help me. Edited 20 Apr 2018 by saruans Share this post Link to post Share on other sites
Posted 20 Apr 2018 Hi, Maybe you could make a FB with a loop. Here is an example to reset an array of bool. You just need and index and a bool as the conditon of the reset. JC Share this post Link to post Share on other sites
Posted 22 Apr 2018 I tried to use your advice and wrote FB with this code picture I got error Could somebody say to me how solve this problem? Share this post Link to post Share on other sites
Posted 23 Apr 2018 I am not familiar with this platform but ... loop ranges do match array dimensions. is this perhaps case sensitive? I see that array declaration starts with upper case... and why is the purpose of IF statement? But more importantly, passing parameters seem to be wrong - you are declaring is as VAR_INPUT (ByValue) but for this to be useful, it must be declared as VAR_IN_OUT (ByReference). example posted by acpi is using proper form... Share this post Link to post Share on other sites
Posted 23 Apr 2018 (edited) I find my mistake. It was masyvas[y,i]=0; need to do masyvas[y,i]:=0; Now I want simplify the main code. My Fb block show now that: If I write that: code working well. when have Input is true, when reset array, but I want to do that: Now problem with top picture, that I have input kuku false, but I wrote something to array DATAS, so immediately reset DATAS. Somebody have advice how solve this problem and update my FB code? fb block text format: IF Leidimas THEN Masyvas1:=Masyvas; FOR i:=1 TO 6 BY 1 DO FOR y:=1 TO 15 BY 1 DO IF(masyvas1[y,i]<>0) THEN masyvas1[y,i]:=0; END_IF END_FOR END_FOR reset:=Masyvas1; done:=TRUE; IF done THEN reset:=Masyvas1; END_IF ELSE i:=1; y:=1; done:= FALSE; END_IF Edited 23 Apr 2018 by saruans Share this post Link to post Share on other sites
Posted 23 Apr 2018 that is because you did not use IN_OUT transfer as suggested Share this post Link to post Share on other sites
Posted 24 Apr 2018 Thanks to you. It is that, what to need for me. Share this post Link to post Share on other sites