It depends on the type you use, the value 65535 is used for WORD and UINT, you could use an REAL, LREAL (which is even larger than REAL), DWORD, DINT or UDINT.
DWORD can go from 0 to 4 294 967 295, so that one should be enough, DINT goes from -2 147 483 648 to +2 147 483 647, and UDINT is the same as DWORD, goes from 0 to 4 294 967 295.
REAL goes from 1.175494351e-38 to 3.402823466e+38, Which is a LOT. And LREAL goes from 2.2250738585072014e-308 to 1.7976931348623158e+308.
Hope this helps
Sendarix
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In my opinion, it would be easier to just make a new counter, without the counter from the standard library, which language are you programming in? ST, Ladder or FBD?
I do have some code which is pretty easy to understand in ST which I ca provide, haven't used Ladder in a while, so I'm not sure I could provide that, but could always try the translation.
My code consist of my own Rising trigger, but since that one is in the Standard library, then it should be easy.
VAR
    Button: BOOL;
  Trigger: R_TRIG;
    Counter_Value: DWORD; (* COULD BE DWORD, DINT or UDINT, or even REAL and LREAL(if the controller supports it) *)END_VARTrigger(CLK:=Button);  (* The button trigger the Rising trigger *)IFTrigger.QTHEN  (*OutputfromtheRisingTrigger*)Counter_Value :=Counter_Value+1;  (* Value of the Counter *)END_IFIFCounter_Value>=1000000THENOUTPUT :=TRUE;  (* If you gonna trigger something *)Counter_Value :=0; (* Reset of the Counter *)END_IF
This is a very easy code, which is in ST.
Sendarix
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
told you many times, look in oscat.de for a nice library.
however yes preset is word, but you can use 2 counters in series this will get you to a DWORD .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
Sarath
Hello,
It depends on the type you use, the value 65535 is used for WORD and UINT, you could use an REAL, LREAL (which is even larger than REAL), DWORD, DINT or UDINT.
DWORD can go from 0 to 4 294 967 295, so that one should be enough, DINT goes from -2 147 483 648 to +2 147 483 647, and UDINT is the same as DWORD, goes from 0 to 4 294 967 295.
REAL goes from 1.175494351e-38 to 3.402823466e+38, Which is a LOT. And LREAL goes from 2.2250738585072014e-308 to 1.7976931348623158e+308.
Hope this helps
Hi
Sarath
Hi,
In my opinion, it would be easier to just make a new counter, without the counter from the standard library, which language are you programming in? ST, Ladder or FBD?
I do have some code which is pretty easy to understand in ST which I ca provide, haven't used Ladder in a while, so I'm not sure I could provide that, but could always try the translation.
My code consist of my own Rising trigger, but since that one is in the Standard library, then it should be easy.
This is a very easy code, which is in ST.
told you many times, look in oscat.de for a nice library.
however yes preset is word, but you can use 2 counters in series this will get you to a DWORD .