Posted 30 Sep 2017 I have created everything right on counting value with C252 but i need when the proced dooes to end the value on C252 to be default liked 1543 when i use command [RST C252] the value goes to 0 , so how can i make it 1543 ? Share this post Link to post Share on other sites
Posted 30 Sep 2017 I actually don't use a lot of counters. I use [INCP D100]. I find it more flexibel. When I want something to happen at a value i use [ = D100 K22] or [ >= D100 K22] as condition. If I wanted the D100 to have a preset value I'd use the MOV instruction. [MOV K1543 D100] I actually expect that you can move a preset value to a counter with the MOV instruction. But I haven't tried it. If C252 is a 32-bit use DMOV. But I repeat, I haven't tested it. Share this post Link to post Share on other sites
Posted 4 Oct 2017 Thanks kraykov , this works well . Another question ? how can i put decimal after point for example 123.20 so encoder count shows me only 12345 ? Share this post Link to post Share on other sites
Posted 4 Oct 2017 Convert the original value to float (e.g. FLT D0 D2). Then divide by 100 (e.g. DEDIV D2 K100 D4), then you'll have a floating point number in D4/D5 with a value of abc.xy. So if the original value is 12345, the "new" value will be 123.45 Share this post Link to post Share on other sites
Posted 7 Oct 2017 Dear Kaarent , it not working ... to the d4 and 5 it shows me only this line -------- Share this post Link to post Share on other sites
Posted 7 Oct 2017 Look at this it could do you good: Share this post Link to post Share on other sites