sequence hour

Hojland

Member
Join Date
Oct 2006
Location
Langå
Posts
203
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
 
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.
 
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.
 
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.
 
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 (y)
 
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.
 
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);
 
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.
 
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.
 

Similar Topics

To sequence through multiple MSG instructions with a Studio 5k program what are some preferred methods?
Replies
6
Views
477
Hi everyone, I am a newbie and I have trouble in the control sequence. I have a system with 4 pumps. The required: Ex: Push a button to start in...
Replies
21
Views
2,703
Hello, I am having some trouble trying to use Port 2 on the direct logic (250-1) for K-sequence. I am trying to use RS-232, I have a breakout...
Replies
0
Views
531
Hi, I am new on RSLogix 5000 programming. Now I am starting a auto machine project and want to control machine process sequentially. I prefer to...
Replies
6
Views
1,570
Hello Experts, I need help from experts of Weintek HMI. I design 5 windows on Easy builder. What i want to do is, Window select randomly and it...
Replies
2
Views
2,008
Back
Top Bottom