You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old September 19th, 2018, 07:50 AM   #1
Hojland
Member
Denmark

Hojland is offline
 
Join Date: Oct 2006
Location: Langå
Posts: 172
sequence hour

I'm trying to make a sequence of 5 steps. They must drive over 12 hours each. TON can not use as they only go to 32767 sec. I have tried to do it with counters, but I can not make it work. Does anyone have an example
  Reply With Quote
Old September 19th, 2018, 07:55 AM   #2
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,050
Use a combination.

You could use a timer to count until you hit 60 minutes. Then use a counter to count to 12. Timer = 60, Count = Count + 1. Reset the timer and repeat.
  Reply With Quote
Old September 19th, 2018, 07:56 AM   #3
Jeebs
Member
Belgium

Jeebs is offline
 
Join Date: Feb 2007
Location: Leuven
Posts: 1,033
Make your own counter/timer?

1s pulse. On each pos edge you add a second. Every 60s you add a minute. Every 60m you add an hour. If value >= setpoint, trigger logic, stop counting or reset counter. Allows timer input for 32767 hours. That's more than 3 years.
  Reply With Quote
Old September 19th, 2018, 08:16 AM   #4
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,569
What resolution do you need? If you can live with 1.5 second resolution, create a TON that resets itself every 1.5 seconds and use it's .DN bit to increment a counter. In twelve hours the counter will accumulate to 28800 counts with each count representing 1.5 seconds.
  Reply With Quote
Old September 19th, 2018, 02:36 PM   #5
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,037
use one second pulse and double integer variable to count up.
Even with signed double integer you get 2,147,483,647 seconds with eguals to 119304 hours for one stage
  Reply With Quote
Old September 19th, 2018, 02:45 PM   #6
ganutenator
Member
United States

ganutenator is offline
 
ganutenator's Avatar
 
Join Date: May 2002
Location: akron, ohio
Posts: 1,109
haha school project. busted
  Reply With Quote
Old September 19th, 2018, 02:51 PM   #7
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 14,187
I'm reasonably confident that this user, who has been posting for twelve years, is not posting a school assignment.

But we'll ask questions anyhow:

What model of PLC are you using ?

Does the PLC have a real-time clock from which you can get the actual time of day ?

How much accuracy do you need ? Counting 1 second timers introduces a small amount of error every time you do so, but counting 1 minute timers introduces less.
  Reply With Quote
Old September 19th, 2018, 03:07 PM   #8
ganutenator
Member
United States

ganutenator is offline
 
ganutenator's Avatar
 
Join Date: May 2002
Location: akron, ohio
Posts: 1,109
Code:
 (*Using 'MachineMotionNxtStep' ensures that all other Sections that use 
'MachineMotionStep' in their case statements get at least 1 scan in their steps.*)
MachineMotionStep:= MachineMotionNxtStep;

Case MachineMotionStep of
	10:(*Bridge Fwd*)
	wash_arm_front_of_car:= false;
	wash_arm_rear_of_car:= false;

	PassNum:= 1;
	
	accu_move10 (target_debounced := (PE1_clear_deb AND PE2_clear_deb and not MaintNoCar) or xt_bridge_stop_cmd OR NOT impacts_ok ,
	             direction_fwd := TRUE,
	             vsd_write_command => Bridge_write_command);
  Reply With Quote
Old September 20th, 2018, 01:56 AM   #9
Hojland
Member
Denmark

Hojland is offline
 
Join Date: Oct 2006
Location: Langå
Posts: 172
Thanks for your help. I solved the problem with counters. And Ganutenator, it was not a school project
  Reply With Quote
Old September 20th, 2018, 01:59 AM   #10
cardosocea
Member
United Kingdom

cardosocea is online now
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,027
Not sure what PLC you are using, but is using the clock function a possibility?

You can save the clock when sequence starts and compare the clock to 12 hours later... I must admit it's not something I've seen much in PLC's, but is commonly used in microprocessors.
  Reply With Quote
Old September 20th, 2018, 02:34 AM   #11
Hojland
Member
Denmark

Hojland is offline
 
Join Date: Oct 2006
Location: Langå
Posts: 172
It is a ML1400. Why is it, that the ML1400 RTC only count in 2-4-6-8-etc seconds
  Reply With Quote
Old September 20th, 2018, 01:23 PM   #12
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 14,187
The MicroLogix RTC clocks only indicate even numbers of seconds.

I don't know why they were designed that way, but they were. The clock is working as intended.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
counter reset on startup (1734-VHSC24) einnh LIVE PLC Questions And Answers 7 June 12th, 2015 05:38 AM
Anyone need Millisecond timing Sequence of Events Data Collection? RussB LIVE PLC Questions And Answers 1 June 6th, 2012 09:31 PM
How to point the Pointer to the current hour? piscis LIVE PLC Questions And Answers 7 October 4th, 2009 05:33 AM
OT: marketing your business geniusintraining LIVE PLC Questions And Answers 48 April 11th, 2007 11:36 AM
G-Code Jim Dungar LIVE PLC Questions And Answers 19 March 18th, 2005 09:44 PM


All times are GMT -5. The time now is 04:29 AM.


.