Hi, do you mean structured text?
If yes, you can use it like this:
PROGRAMPLC_PRGVARÂ Â fbCTU1:CTU;Â Â xCountUp1:BOOL;Â Â uiCounter1:UINT;Â Â xReset1:BOOL;Â Â xCountUp2:BOOL;Â Â uiCounter2:UINT;Â Â xReset2:BOOL;END_VAR
//CTUFunction-blockfbCTU1(
  CU:=xCountUp1,
  RESET:=xReset1,
  PV:=100,
  Q=> ,
  CV=>uiCounter1);
 Â
//OrIFxCountUp2THEN
  uiCounter2 :=uiCounter2+1;
  xCountUp2 :=FALSE;END_IFIFxReset2THEN
  uiCounter2 :=0;END_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please can anybody tell me how to create counter up with math instructions??
Hi, do you mean structured text?
If yes, you can use it like this:
Thank for that, but I must do CTU in ladder diagram only with math and compare instruction!
Everytime when I put "1" on my firt input some memory registar must increase for 1.
See screenshot for an example