Sign in to follow this  
Followers 0
gilgora

Programming

15 posts in this topic

hi every one im new on this but im learning.... this is my problem i want to use the command DHOUR to display in the HMI death time in my process but it only show me hours and i will like to see minutes too, i try to use retentive timers but i can only use it until 32,767 how can i use timers whit a bigger K than 32,767.

Share this post


Link to post
Share on other sites
I'm not sure that I understood your question, but you could use bigger data types. Use a float or a double instead of an int. If the timer doesn't support it directly then use another register like a place value system. When the timer gets to a certain value reset it and increment your other counter.

Share this post


Link to post
Share on other sites
What PLC range are you using? In a Q series, you can use the DATERD instruction, this will move the current PLC time & Date into 7 D registers in the following format: Year Month Day Hour Minute Second Weekday

Share this post


Link to post
Share on other sites
the plc is a fx2n and what i want to know is, how long time the machine its not working, and i dont know if i could use a timer for 32 bits and count more than 32767

Share this post


Link to post
Share on other sites
On the FX series PLCs timers will only get you to 100ms * 32767, which is just under an hour. Use a self-resetting timer to time one minute and a counter to count the number of minutes. This will get you to 32767 minutes with a standard 16-bit counter. If you need more, use a 32-bit counter. T0 --|/|----------( OUT T0 K600 )-- T0 --| |-------( OUT C0 K32767 )--

Share this post


Link to post
Share on other sites
thanks the counter works good i was using a lot of Timers, compare, add but your idea its better

Share this post


Link to post
Share on other sites
The FX2N has commands to add and subtract times in hours minutes and seconds. With these, you could store the PLC clock when the system stops using TRD, and then when it starts use TRD to store those numbers, and then use TSUB to subtract one time from the other. TRD is going to store all 7 registers of the clock, but you only need 3 for TSUB (hours, minutes, and seconds). This is covered in section 5.14 of JY992D88101 manual.

Share this post


Link to post
Share on other sites
HI EVERY ONE WHAT MEANS P AFTER EACH COMMAND ITS FOR PULSE OR SOMETHING

Share this post


Link to post
Share on other sites
The "P" modifier does indeed mean pulse. Any instruction modified with P will only operate once (pulse) on the Off-to-On transition of the input conditions.

Share this post


Link to post
Share on other sites
hi everyone i have a problem i did all the other things before but i still cant hold the information i try to use TADD and display it in the HMI but it show me others numbers. what i do was use TRD and TRDP and then i used TSUB to get the time the machine its not working, and if a put the information of the TSUB in the HMI its ok it show me seconds, minute, and hours but if i try to put that information in TADD to add the time each time its stop and then display it in the HMI but it show me other numbers somebody know why

Share this post


Link to post
Share on other sites
It sounds like you are using the proper commands. Could you perhaps post your code so we might take a look at it?

Share this post


Link to post
Share on other sites
if I put the result of TSUB (D784 hours, D785 minute, D786 seconds) and i display it in the HMI it show me what I want but if I take the result of TSUB for the TADD it show me other numbers, look I try this: /M505/-----------------[TRD D776] this is always checking the real time / / /M505/// this is normaly closed /M508/-----------------[TRDP D768] this activate when the machine stop M508/----------------[TSUB D779 D771 D784] I took D779 and D771 for only take hours, minute and seconds / /--------------[TADD D784 D800 D800] My problem is; if I use D800 D801 and D802 to display hours, minute and second in the HMI it show other numbers, but I dont know if TADD its the correct command

Share this post


Link to post
Share on other sites
TADD and TSUB are the best commands for what you seem to be doing. Are there other items in the PLC program which might be modifying those addresses?

Share this post


Link to post
Share on other sites
No I check that but still have the problem I dont know if Im using the correct setting in the HMI (its a E300) I choose the option analog numeric to display the number but there is an option than say unsigned 16 bits, signed 16 bits, 32 bits, float, etc I dont know if that affect

Share this post


Link to post
Share on other sites
By default all of the values in the PLC would be 16-bit signed binary.

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