JaySharp90

Using the TIML instruction

4 posts in this topic

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 by JaySharp90

Share this post


Link to post
Share on other sites

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.

MrPLC_TIML.thumb.jpg.fbfa7a17a688e88346d

Share this post


Link to post
Share on other sites

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.

TIML.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now