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 May 25th, 2010, 11:14 AM   #16
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 6,147
Quote:
and then used a counter to calculate the running hours...
If you are wanting to totalize running hours then take consider using the TOT instruction.

To configure TOT to totalize hours, fix the TOT tagname.In value at 1.0. Fix the gain at 1.0 and set tagname.timebase to 2. This configures the TOT to totalize time in units of hours. Use the tagname.EN bit to start/stop time totalizing. Now you have a run hour meter.

The TOT tag contains some other useful elements named .Target and .TargetDev1 and .TargetDev2. Set Target to the time where you want to signal needed maintenance on the motor. .TargetDev1 and TargetDev2 can be set to give you advance warning that the maintenace time is approaching. .TargetFlag, .TargetDev1Flag, and .TargetDev2Flag are booleans that turn on when the TOT reaches the specified value. Once maintenance has been performed add the required time interval until the next maintenance is required to the .Target.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.
  Reply With Quote
Old May 7th, 2011, 09:48 AM   #17
tomalbright
Member
United States

tomalbright is offline
 
Join Date: May 2006
Location: Gonzales, LA
Posts: 691
[ZOMBIE THREAD #2 - can't kill 'em!]

I'm doing some runtime montoring. The guy who started it used a timer and boy was it off. I am using a second based off the Controllogix clock now. My concern is that we're still losing time. Basically the runtime is checked, then a subroutine is entered. On the one-second tick, the time is incremented. Program scan is around 160ms; I'm afraid we're missing the tick every now and then.

Is there a good way to do this? I'm thinking of abandoning the subroutine. A scheduled task may work, but I still think we might lose a little on that.

Runtime solutions? Alaric, the TOT looks nice but I'm using discrete inputs.

EDIT TO ADD:

My one second pulse solution (no pix!):

BST GRT PLC.Clock_Read.Second Prev_Clock_Second MOV PLC.Clock_Read.Second Prev_Clock_Second NXB EQU PLC.Clock_Read.Second 0 MOV 0 Prev_Clock_Second BND ONS New_Clock_Second_ONS OTE New_Clock_Second
__________________
"We really don't care how you program your PLC, just don't blow yourself up!"
www.GeekQuake.com Also on Facebook!


Last edited by tomalbright; May 7th, 2011 at 09:52 AM.
  Reply With Quote
Old May 7th, 2011, 10:16 AM   #18
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 6,200
To simplify change to:

NEQ PLC.CLOCK_READ.SECOND PREV_CLOCK_SECOND BST MOV PLC.CLOCK_READ.SECOND PREV_CLOCK_SECOND NXB OTE NEW_CLOCK_SECOND BND

[Edit - delete "Otherwise it looks ok."]

Your code won't issue the pulse 'New_Clock_Second' on the transition from zero to one. Mine will.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com

Last edited by bernie_carlton; May 7th, 2011 at 10:24 AM.
  Reply With Quote
Old January 15th, 2013, 03:16 AM   #19
matteo_xtr
Member
Romania

matteo_xtr is offline
 
Join Date: Nov 2012
Location: romania
Posts: 1
Anyone knows how to declare a one second pulse in the Rslogix 5000? Is there any command for this function? It does not same like GE or other PLC where the 1s pulse is an internal bit. How to declare a bit or a tag to have this function? I am using Allen Bradley 1769-L33R controller. Appreciate for those can help. Thanks
  Reply With Quote
Old January 15th, 2013, 03:49 AM   #20
Daye.04
Member
Norway

Daye.04 is offline
 
Join Date: Jul 2012
Location: Fredrikstad
Posts: 70
So ... You copied the OP's post? have you read the replies? It might just be helpful even though you have a different version ...
__________________
-See Iant's signature for inspirational quote-
Your friendly neighbourhood engineer

If I somehow forgot to mention it - thanks for your help ^^
  Reply With Quote
Old February 18th, 2016, 05:53 PM   #21
JeremyM
Member
United States

JeremyM is offline
 
Join Date: May 2014
Location: Texas
Posts: 356
Post For the structured text types out there...

I wanted to share some code for pulse generation. We recently purchased the ST add-on and upgraded a couple of our newer controllers to v24, so I've been converting existing Add-On-Instructions and a utility program (the performance gains aren't imaginary!).

This snippet generates one and half-second pulses using the same approach as a ladder DTR - bitwise masking and references. If you recognize the mask pattern, you can extend this to quarter, eighth, sixteenth-second pulses, and so on:
Code:
// Parse the controller's WallClockTime
GSV(WallClockTime, ,LocalDateTime, RealTimeClock.Year);

// Generate a pulse each second
IF( (RealTimeClock.Second & 16#000000FF) = RTC_Reference[0]) THEN
	OneSecPulse := 0;
ELSE
	RTC_Reference[0] := RealTimeClock.Second & 16#000000FF;
	OneSecPulse := 1;
END_IF;

// Generate a pulse each half-second
IF( (RealTimeClock.Microsecond & 16#00080000) = RTC_Reference[1]) THEN
	HalfSecPulse := 0;
ELSE
	RTC_Reference[1] := RealTimeClock.Microsecond & 16#00080000;
	HalfSecPulse := 1;
END_IF;

// End of function
Another function within the utility program accumulates the controller's running time using the above function's output:
Code:
// Reset the running time if the controller has
// just been powered on or toggled from Program
// to Run mode.
IF (S:FS) THEN
	ControllerRuntime.Second := 0;
	ControllerRuntime.Minute := 0;
	ControllerRuntime.Hour := 0;
	ControllerRuntime.Day := 0;
END_IF;

// increment running seconds
IF (NOT S:FS AND NOT OneShots[1] AND OneSecPulse) THEN
	ControllerRuntime.Second := ControllerRuntime.Second + 1;
END_IF;
OneShots[1] := OneSecPulse;

// increment running minutes
IF (ControllerRuntime.Second = 60) THEN
	ControllerRuntime.Minute := ControllerRuntime.Minute + 1;
	ControllerRuntime.Second := 0;
END_IF;

// increment running hours
IF (ControllerRuntime.Minute = 60) THEN
	ControllerRuntime.Hour := ControllerRuntime.Hour + 1;
	ControllerRuntime.Minute := 0;
END_IF;

// increment running days
IF (ControllerRuntime.Hour = 24) THEN
	ControllerRuntime.Day := ControllerRuntime.Day + 1;
	ControllerRuntime.Hour := 0;
END_IF;
edit: in addition upgrading to v24 made it easy to reference the pulses in other programs: "\Utilities.OneSecPulse" as a public parameter generally eliminates the need to write and read controller-scoped tags and keep track of what program does what at the controller scope.
  Reply With Quote
Old March 29th, 2016, 06:50 AM   #22
hamid hadi
Member
Romania

hamid hadi is offline
 
Join Date: Dec 2015
Location: bukharest
Posts: 23
hello Tconnolly
i make program like your program but its give me just on bit high and dont goes to low its still high?
  Reply With Quote
Old March 31st, 2016, 05:13 AM   #23
hamid hadi
Member
Romania

hamid hadi is offline
 
Join Date: Dec 2015
Location: bukharest
Posts: 23
Hello
Please any one can help me. I need this pulse generator and i did what are you mentioned above about making the task as a periodic. But it's run the output and still the output on
  Reply With Quote
Old March 31st, 2016, 05:16 AM   #24
hamid hadi
Member
Romania

hamid hadi is offline
 
Join Date: Dec 2015
Location: bukharest
Posts: 23
Hello
Please any one can help me. I need this pulse generator and i did what are you mentioned above about making the task as a periodic. But it's run the output and still the output on
  Reply With Quote
Old April 1st, 2016, 12:03 PM   #25
ladiesandtech
Member
Canada

ladiesandtech is offline
 
Join Date: Mar 2016
Location: london
Posts: 5
You can create a flashing bit using timers. Check out the video I know it's for Rslogix500 but it's the same ladder logic.

http://ladiesandtech.com/2016/03/04/...rs-on-youtube/
  Reply With Quote
Old December 7th, 2016, 08:31 AM   #26
madnaz
Member
Malaysia

madnaz is offline
 
Join Date: Mar 2014
Location: Puchong
Posts: 1
this the best way, i think so...i also tried this way..and the timming not run much..and if correcting the timming using SSV with pc timmer, i thing its help much.
  Reply With Quote
Old January 3rd, 2018, 03:14 PM   #27
Mike Lamond
Member
United States

Mike Lamond is offline
 
Join Date: Oct 2009
Location: Syracuse, NY
Posts: 69
This thread was referenced from another thread today, so I'll add my comment here.

About 10 years ago, on my first major Logix 5000 project, I tested a wall clock-derived one second pulse similar to Bernie's code in post #18 against a 1000 msec repeating timer. Over time, the timer lost counts against the clock pulse. Using a 500msec periodic task to toggle a bit was not an option as we were using Version 13 redundancy which allowed only continuous tasks.

One-shot vs 500ms on/ 500ms off doesn't matter to elapsed time counter inputs. However, flow totalizers use math functions which execute on every scan where the rung is true, so they require a one-shot trigger to work properly.

Mike
  Reply With Quote
Old January 3rd, 2018, 03:33 PM   #28
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,344
Quote:
Originally Posted by Mike Lamond View Post
This thread was referenced from another thread today, so I'll add my comment here.

About 10 years ago, on my first major Logix 5000 project, I tested a wall clock-derived one second pulse similar to Bernie's code in post #18 against a 1000 msec repeating timer. Over time, the timer lost counts against the clock pulse. Using a 500msec periodic task to toggle a bit was not an option as we were using Version 13 redundancy which allowed only continuous tasks.

One-shot vs 500ms on/ 500ms off doesn't matter to elapsed time counter inputs. However, flow totalizers use math functions which execute on every scan where the rung is true, so they require a one-shot trigger to work properly.

Mike
Assuming that one does have the ability to employ a periodic task, no pulse reference bit is required. An unconditional logic statement will execute once per second in a program running under a periodic task with a 1000 ms time base.

Why bother with a redundant trigger?
__________________
  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
How To Enter Rslogix 5000???? sundar_scada LIVE PLC Questions And Answers 14 April 2nd, 2016 03:50 PM
Rockwell Allen Bradley Programming Software, RSLogix 5, RSLogix 500, RS Linx, RSLogix vvcd LIVE PLC Questions And Answers 21 September 24th, 2009 10:04 PM
Migrating VB6 IDEA app to VB.Net Extrasoft LIVE PLC Questions And Answers 5 November 4th, 2007 06:13 AM
Gray Code and RSLogix 5000 IAA LIVE PLC Questions And Answers 5 September 28th, 2007 09:27 AM
RSLogix 5000 V15 Features Samneggs LIVE PLC Questions And Answers 18 April 20th, 2006 05:45 PM


All times are GMT -5. The time now is 01:57 AM.


.