Continous Addition of a Constant

debco99

Member
Join Date
Feb 2007
Location
california
Posts
16
This has to be simple however I can't figure a way to do this.

If as a result of a calculation the number lets say is 3.

I want to add that number every second until a timer is complete.

So first second 3, second second 6, third 9 and so on .

The plc is an Idec Pentra.

Thanks in Advance
 
Last edited:
I could see using a second timer to count every second. Not sure how the Idec's work but I would assume the have a bit that gets set when a timer is done.

Set a second timer for a 1 second duration and do the math everytime the timer goes done. Have the same rung the math is in reset the timer.
 
You could set up a 1 second timer, and everytime it's done bit goes high your constant value gets added.
It could be enabled when your main timer starts, and use the main timers run bit to initiate the second timer.
 
Here is a sample for an Idec PLC. If there is any possibility that M0 will exceed maximum allowed value (65565), then you need to add a routine to handle overflow register when special internal overflow relay M303 is set. Also you need to add a rung to clear M0 to 0, and reset Timer T0 when you are done with the number.

ADD_3_ROUTINE4.JPG
 
Last edited:

Similar Topics

I am working on a project that requires an additional remote rack (say about 150 i/o points) on a L73 redundancy system with about 900 i/o points...
Replies
0
Views
876
Hi to all, I have a power supply "gwinstek" PSP-2010, with rs-232, so I want to control it with S7-1200 "1212acdcrly with CM-1241 RS-232 module...
Replies
2
Views
1,462
I was going over the code for one of our process unit and discovered that our PID loops are in the continuous task. I know they are usually placed...
Replies
20
Views
5,948
Had an interesting phone call today with a fellow controls engineer who claimed that Continuous tasks are bad for the processor and cause it to...
Replies
15
Views
8,549
Guys, My Versa View 7000 is acting up again. It is continously restarting/rebooting during start of the OS.What is happening here?
Replies
2
Views
1,703
Back
Top Bottom