Sign in to follow this  
Followers 0
jonny_cooke

Getting NS8 to display TIML data

9 posts in this topic

Hi everyone, could do with some assistants, getting a little confused :( I have a cj1m cpu11 PLC and a NS8 touch screen connected together and working a treat :) From the NS8 i have 4 individual on/off momentary buttons. They are set to trigger 2000.05 through to 2000.08. pb1- 2000.05 triggers a MOV function within the PLC, moving #9000 (15 minute) time into 2200 which is the SV word on a TIML instruction pb2- 2000.06 does the above #18000 (30 minute time) pb3- 2000.07 does the above #27000 (45 minute time) pb4- 2000.08 does the above #36000 (60 minute time) When each button is pushed they MOV data to the same TIML instruction depending on which button is pushed. They also input to a SET instruction 2100.05 whos funtion is to start the timer counting. The Completion Flag of the TIML is 2300 which RSET 2100.05 The PV word of the TIML is 2400. Now ive got that info laid down, my question is this, i want to let the user know what the current time is left on the timer till completion on my NS touch screen. Ive generated a 'Numeral Display & Input' box and linked it to 2400 (PV word) My problem is that the NS instead of reading #.... it seems to be counting down in HEX, i think. How can i alter this. Please help, its bursting my feeble little mind. Kind Regards Jonny Cooke Edited by jonny_cooke

Share this post


Link to post
Share on other sites
I should just like to make note of an alteration, i was using MOV instruction which was fine when i have been bench testing using smaller #numbers for my timer. I am now using MOVL to accomodate for the extra numbers required for the 30, 45 and 60 minute timer. i.e MOV is restricted to 4 digits where as MOVL can have upto 8. Slaps head, silly boy!

Share this post


Link to post
Share on other sites
The TIML instruction uses BCD numbers. So, when you put the display on the HMI, you need to set it up to be a 2 word BCD value, like this: Another option would be to just use the TIMX instruction. This instruction works in integer format and would allow you to use a single word standard timer and give a range from 0.0 to 6553.5 seconds. The catch with this instruction is that ALL of your timers and counters would then work in Binary (integer) format when using the CJ1M processor. You have to choose either BCD or Binary (integer) format for the entire project. To do this, right click on the processor and choose properties as shown: Then select the Execute Timer/Counter as binary as shown below: Then all of your timer and counter instructions will have to be TIMX and CNTX (as 2 examples). When entering constants, you will then have to use & instead of #. For instance, your MOVL instructions that moved #36000 into a register would then just be MOV instructions that move &36000 into a register.

Share this post


Link to post
Share on other sites
Thanks very much for your reply Micheal. I'm not in work till Monday now but I'll have a look and see if your method is better than what I came up with. I did get it working in the end of a fashion but it was probably over complicated due to lack of experience. I think I did some thing similar to what you suggested and then used a counter in loop to pulse every #600 on the back of TIML (I.e one minute). These one minute counts are then fed into a subtraction instruction which subtracts one from the set time (I.e 15 minutes) which the NS now looks at and displays minutes remaining counting down ? which is more user friendly than 9000 seconds. Although it probably would have been more fun leaving it like that and watching the factory floor staff with calculators out and scratching heads.

Share this post


Link to post
Share on other sites
Though this doesn't directly relate to your issue, as a general note I always set the PLC to "Execute Timer/Counter as Binary" [as noted in previous post] AND set all the project properties in the NS to "Binary". Just makes overall programming/setup easier to understand vs. aged BCD. Just remember to use the "&" prefix for all binary values in CX Programmer. My 2 cents.

Share this post


Link to post
Share on other sites
I agree. There is no reason to use BCD these days when working on a new program with a new PLC. It is inefficient and confuses some programmers that have not been exposed to it. I recently told a customer recently that "BCD is dead." Omron PLCs default to using BCD (on models that make you choose) for timers and counters because older PLCs only supported BCD for these instructions, so the default allows for conversion of old programs.

Share this post


Link to post
Share on other sites
Thanks to both of you, I will utilise what you have told me in the future

Share this post


Link to post
Share on other sites
Couldn't agree more, BCD IS DEAD!!

Share this post


Link to post
Share on other sites
I use this FB for 'long' times. It brings in a couple of other FBs. Just create instances of HHMMSS as you need them. You can give it any H, M, S (eg 99 mins 500 seconds if you want). The time remaining it gives you is normalised as H, M and S as INTs which can be easily displayed. http://forums.mrplc.com/index.php?/files/file/1025-hhmmsscxf/ Pp

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
Sign in to follow this  
Followers 0