Posted 28 Jun 2017 (edited) Hi all, I'm fairly new to cx-programmer and I'm having a bit of difficulty with implementing the long timer (TIML). The ultimate goal is to set up two timers, the duration of which is dependent on some sort of user input from the HMI. I know for sure that the TIM will be insufficient in terms of timer length, and given I don't know the exact timing required I decided against just implementing multiple TIM timers. I've had a look at the manual and instruction help for TIML, where it says TIML D1 D2 S, where D1 corresponds to completion flag, D2 to PV and S to SV. No matter what I try, the timer just seems to finish immediately or shows Error (side note: is there any way to see what the error actually is?), no matter I define S to be. If I'm understanding the help correctly I should be able to do something like: TIML 200 D100 D200 where D200 is some value that I define? I guess that bit is what is tripping me up. As an example, one calculation for the timer resulted in the timer needing to be 24min (or 1440 seconds) in duration. So since TIML uses 0.1s increments I would want to define the S as 14400. How would I go about doing this? I am using cj1m cpu23 if that makes a difference. Regards, Jay Edited 28 Jun 2017 by JaySharp90 Share this post Link to post Share on other sites
Posted 28 Jun 2017 In the example, D200 is the Set Value that you define. You are correct that it should be #14400. Take note to the preceding "#". This denotes a BCD value. Here is an example using the memory locations from the instruction help. I've set the SV to 10 seconds with the MOVL instruction. Share this post Link to post Share on other sites
Posted 28 Jun 2017 Jay, Welcome to the forum! Please see the screen shot from the manual. The PV and S are both double length, meaning D200 AND D201 are being used for the set value. By default the set value is BCD, you would need to enter #4400 in D200 and #0001 in D201. Also make sure that D100 and D101 are not being used elsewhere in your program. Hope this helps. Share this post Link to post Share on other sites
Posted 3 Jul 2017 thanks you both, I have managed to get it working! Share this post Link to post Share on other sites