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 January 3rd, 2018, 12:24 AM   #1
muds
Member
Pakistan

muds is offline
 
Join Date: Apr 2014
Location: karachi
Posts: 70
rslogix5000 1 sec pulse

HI ,,

I Want to create 1 sec pulse in rslogix 5000.
can anyone tell how to create this. so that i can calculate machine runtime.

thanks,
  Reply With Quote
Old January 3rd, 2018, 12:48 AM   #2
tarik1978
Member
Morocco

tarik1978 is offline
 
Join Date: Mar 2010
Location: casablanca
Posts: 306
The bellow thread should help you
http://www.plctalk.net/qanda/showthread.php?t=43936
  Reply With Quote
Old January 3rd, 2018, 06:13 AM   #3
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,366
Quote:
Originally Posted by muds View Post
HI ,,

I Want to create 1 sec pulse in rslogix 5000.
can anyone tell how to create this. so that i can calculate machine runtime.

thanks,
How much do you want to count up to ?

Why not use a RTO (Retentive Timer-On) set for 1 hour, and a counter to count hours.

2,147,483,647 hours is 89,478,485 days, or more than 245,146 years !! I think much more than enough for the application....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old January 3rd, 2018, 06:42 AM   #4
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 955
Quote:
Originally Posted by daba View Post
2,147,483,647 hours is 89,478,485 days, or more than 245,146 years !! I think much more than enough for the application....
I pity that poor maintenance technician on 245,147 years

And probably won't have the right version either.
  Reply With Quote
Old January 3rd, 2018, 07:02 AM   #5
widelto
Member
Colombia

widelto is online now
 
widelto's Avatar
 
Join Date: Jul 2005
Location: barranquilla
Posts: 2,547
Its better to use an AOI called "elapsed time add on instruction".
Go and download it from :
http://search.rockwellautomation.com...time%20elapsed
__________________
My two cents.
  Reply With Quote
Old January 3rd, 2018, 07:42 AM   #6
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,016
I use the system clock for this, built an AOI to handle it but essentially I'm using a GSV to get the WallClockTime parts. I then use a one shot rise/fall on bit.0 of the time part I am interested in to create a second/minute/hour...etc pulse.

That pulse is then used with a counter in various parts of the program where needed.

Note, my AOI is in ST and has output bits for sec/min/hour pulses.
  Reply With Quote
Old January 3rd, 2018, 07:52 AM   #7
John Morris
Member
United States

John Morris is offline
 
John Morris's Avatar
 
Join Date: Sep 2015
Location: San Antonio
Posts: 597
Not an original design

It's fairly accurate.
Attached Images
File Type: png TICK TIMER.PNG (10.0 KB, 138 views)
__________________
"When nothing is going right, go left."

"Even a fish wouldn't get into trouble if it kept its mouth shut."
(I should probably look into this)
  Reply With Quote
Old January 3rd, 2018, 07:55 AM   #8
widelto
Member
Colombia

widelto is online now
 
widelto's Avatar
 
Join Date: Jul 2005
Location: barranquilla
Posts: 2,547
Paully I like your approach, I do not want to reinvent the wheel, can you post it ?
__________________
My two cents.

Last edited by widelto; January 3rd, 2018 at 07:57 AM.
  Reply With Quote
Old January 3rd, 2018, 09:33 AM   #9
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,366
Quote:
Originally Posted by John Morris View Post
Not an original design

It's fairly accurate.
It's only as accurate as it can be, bearing in mind you haven't accounted for the timer accumulator being greater than 1000 which it can be, depending on how frequently it is scanned.

The error will always be positive, so your "Tick" will always be longer than 1 second.
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; January 3rd, 2018 at 09:56 AM.
  Reply With Quote
Old January 3rd, 2018, 10:30 AM   #10
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,394
Quote:
Originally Posted by muds View Post
HI ,,

I Want to create 1 sec pulse in rslogix 5000.
can anyone tell how to create this. so that i can calculate machine runtime.

thanks,
You don't need a 1 second pulse bit if you create a program within a 1000 ms periodic task. You can then simply operate your math statements unconditionally and they will be processed once per second.

You should know that you'll eventually run into rounding errors if totalizing with floating point math, unless you take measures to prevent this from happening.
__________________
  Reply With Quote
Old January 3rd, 2018, 10:57 AM   #11
Paully's5.0
Lifetime Supporting Member
United States

Paully's5.0 is offline
 
Join Date: Jan 2006
Location: WI
Posts: 2,016
Quote:
Originally Posted by widelto View Post
Paully I like your approach, I do not want to reinvent the wheel, can you post it ?
Here is the ST, the AOI parameter input/output definitions should be pretty obvious.

Code:
// Get PLC Time
GSV(WallClockTime,,localdatetime,DateTime[0]);

// Parse out PLC time to friendly format
year := DateTime[0];
month := DateTime[1];
day := DateTime[2];
hour := DateTime[3];
minute := DateTime[4];
second := DateTime[5];
microsecond := DateTime[6];

// 1 Second pulse generation
// Triggered by the rise/fall of bit 0
SecondOSR.InputBit := second.0;
OSRI(SecondOSR);
SecondOSF.InputBit := second.0;
OSFI(SecondOSF);
secPulse := (SecondOSR.OutputBit OR SecondOSF.OutputBit);

// 1 Minute pulse generation
// Triggered by the rise/fall of bit 0
MinuteOSR.InputBit := minute.0;
OSRI(MinuteOSR);
MinuteOSF.InputBit := minute.0;
OSFI(MinuteOSF);
minPulse := (MinuteOSR.OutputBit OR MinuteOSF.OutputBit);
  Reply With Quote
Old January 3rd, 2018, 12:02 PM   #12
Aardwizz
Member
United Kingdom

Aardwizz is offline
 
Aardwizz's Avatar
 
Join Date: Dec 2017
Location: Swindon
Posts: 142
Let me count the ways

The most commonly found in code (also the most inaccurate, but good enough for Motor Run Times

AUX OneSecTmr.DN OneSecTmr
+------TON --+
---| |------------|/|-----------| PRE: 1000 |
+------------+

Use the OneSecTmr.DN bit as your pulse.


The inaccuracy in this code is on the order of 2% short. You lose one full scan, plus the overrun of the scan time when the TON was last executed.

Since the "Run Time" is mostly for guestimating ("That's a lot of time; we should get ready to service it") or comparison ("Motor A has more run time than Motor B"), accuracy isn't an issue.


The code that John Morris posted is a more, but not perfectly accurate. It eliminates the missed scan (for not-true TON to reset the .DN bit), but still loses scan elapsed time (as daba pointed out)

Presumably you are counting seconds to display hours. If you use a TON to actually time hours, you lose lots of fractional hours each time the motor turns off. A Retentive timer prevents that loss, and putting the reset before the timer means that the DN bit will be on for one scan.

OneHrPulse.DN OneHrPulse
----------| |-------------[ RES ]

AUX OneHrPulse
+----------RTO--+
--------| |------------| PRE: 3600000 |
+---------------+



The amount of inaccuracy in this timer is on the order of .001%. More than good enough for Run Time, and if you want to include fractional hours, just add your integer hour count + ACC/PRE.


The most accurate 1 sec pulse counter is to

AUX RUNNING_TMR
+-------------RTO--+
--------| |------------| PRE: 2147483647 |
+------------------+

+-----------GRT---+ +------------SUB---+ OneSecPulse
----| RUNNING_TMR.ACC |--------| RUNNING_TMR.ACC |---------( )-
| 1000 | | 1000 |
+-----------------+ | RUNNING_TMR.ACC |
+------------------+


The timer never DONEs out, and is never reset. But it also never accumulates more than 1 second of total elapsed time. It never loses the scan overruns.

Overkill for a Running Time counter, but is as accurate or more as using a Timed Task.
  Reply With Quote
Old January 3rd, 2018, 12:43 PM   #13
A_G
Member
United States

A_G is offline
 
Join Date: Jul 2014
Location: MA
Posts: 93
Quote:
Originally Posted by daba View Post
How much do you want to count up to ?

Why not use a RTO (Retentive Timer-On) set for 1 hour, and a counter to count hours.

2,147,483,647 hours is 89,478,485 days, or more than 245,146 years !! I think much more than enough for the application....
I used this method (retentive timer) with a customer that wanted run time for different pumps to estimate when to perform maintenance on them.
  Reply With Quote
Old January 3rd, 2018, 01:47 PM   #14
John Morris
Member
United States

John Morris is offline
 
John Morris's Avatar
 
Join Date: Sep 2015
Location: San Antonio
Posts: 597
Quote:
Originally Posted by daba View Post
It's only as accurate as it can be, bearing in mind you haven't accounted for the timer accumulator being greater than 1000 which it can be, depending on how frequently it is scanned.

The error will always be positive, so your "Tick" will always be longer than 1 second.
You are correct kind sir, but the application didn't call for T*Ts on timing. It just needed to count out ten minute cycle times, +/- 2 or three seconds was ok.

I wouldn't have used it for high speed bottling/canning.

I figured it would have suited the OP's request.
__________________
"When nothing is going right, go left."

"Even a fish wouldn't get into trouble if it kept its mouth shut."
(I should probably look into this)
  Reply With Quote
Old January 3rd, 2018, 02:07 PM   #15
rankhornjp
Member
United States

rankhornjp is offline
 
Join Date: Dec 2008
Location: Georgia
Posts: 156
There is a P_RunTime AOI that will track runtimes and number of starts, its part of the PlantPAX library.

http://literature.rockwellautomation...m010_-en-e.pdf
  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
1 sec pulse bit running up my ADD instruction to fast Snap25 LIVE PLC Questions And Answers 12 April 20th, 2015 11:39 AM
Foxboro CFT50 pulse output 95ee32069 LIVE PLC Questions And Answers 0 January 6th, 2011 01:24 PM
5 Sec Clock Pulse bit timmer shresp LIVE PLC Questions And Answers 1 November 6th, 2007 08:29 AM
Pulse Count - not exactly what flowmeter says it should be (Logix 500) TimD LIVE PLC Questions And Answers 9 October 2nd, 2007 09:55 PM
s7-200 High Speed Pulse Output / Counter hawkeyen2001 LIVE PLC Questions And Answers 0 September 19th, 2007 07:28 AM


All times are GMT -5. The time now is 02:39 PM.


.