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 February 25th, 2018, 10:35 PM   #1
Badu
Member
Australia-Aboriginal

Badu is offline
 
Badu's Avatar
 
Join Date: Feb 2018
Location: Dampier
Posts: 2
Question Square Wave Pulse Generator

G'day

Can anyone explain what the reasons for having Square Wave Generators in a PLC code?

Cheers
  Reply With Quote
Old February 25th, 2018, 10:51 PM   #2
Mickey
Lifetime Supporting Member
United States

Mickey is offline
 
Mickey's Avatar
 
Join Date: May 2003
Location: Palmdale,Ca
Posts: 10,145
Pulse an alarm horn or light.

Watch dog pulse between two devices.
__________________
Mickey

If you want happiness for an hour-take a nap. If you want happiness for a day-go fishing. If you want happiness for a month-getmarried. If you want happiness for a year-inherit a fortune. If you want happiness for a lifetime-help someone else.
----- Chinese Proverb
  Reply With Quote
Old February 25th, 2018, 11:04 PM   #3
Badu
Member
Australia-Aboriginal

Badu is offline
 
Badu's Avatar
 
Join Date: Feb 2018
Location: Dampier
Posts: 2
Cheers Mickey
  Reply With Quote
Old February 26th, 2018, 01:33 AM   #4
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: Vancouver, WA, US
Posts: 6,749
Quote:
Originally Posted by Mickey View Post
Watch dog pulse between two devices.
This is not a good idea. One of my customers got bit by doing this. It turned out the watch dog routine in the PLC was timing out because it didn't see the bit change. The problem turned out to be the PLC was polling the bit synchronously to the bit changing off then back on so the PLC did not see the bit go off.
It is best to increment a integer and check to see if the integer changes.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 26th, 2018, 03:02 AM   #5
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,110
Quote:
Originally Posted by Peter Nachtwey View Post
It is best to increment a integer and check to see if the integer changes.
This is my preference too, the kicker being that if the third party system I'm interfacing has someone stubborn and not open to make a rolling counter, I don't have to change my logic to match his code.

I'll keep incrementing and point him to the LSB.
  Reply With Quote
Old February 26th, 2018, 05:46 AM   #6
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,401
Quote:
Originally Posted by cardosocea View Post
This is my preference too, the kicker being that if the third party system I'm interfacing has someone stubborn and not open to make a rolling counter, I don't have to change my logic to match his code.

I'll keep incrementing and point him to the LSB.
I prefer to use a "bit-chase"....

In PLC1....

XIC PLC2_Bit OTE PLC1_Bit

In PLC2....

XIO PLC1_Bit OTE PLC2_Bit

The bits will just keep on toggling, at the comms rate. It is easy to use a simple grace timer in both PLCs if it ever stops.


In A-B Logix5000, I use the "CONNECTION_STATUS" member of a Produced/Consumed tag to determine if a remote PLC is "Connected", and "Running". This is a much faster method, as it doesn't rely on cyclic messages and grace times, the Connected and Running bits are updated at the RPI of the "Connection" to the remote controller.
__________________
___________________________
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 February 26th, 2018, 06:44 AM   #7
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,110
Quote:
Originally Posted by daba View Post
I prefer to use a "bit-chase"....

In PLC1....

XIC PLC2_Bit OTE PLC1_Bit

In PLC2....

XIO PLC1_Bit OTE PLC2_Bit

The bits will just keep on toggling, at the comms rate. It is easy to use a simple grace timer in both PLCs if it ever stops.
Doesn't this put you in a similar situation highlighted by Peter N.? Though with a small chance of happening?

This is something that people do miss quite often and in the Siemens world can be a world of difference as the PUT/GET instructions always work no matter what the state of the processor is.
  Reply With Quote
Old February 26th, 2018, 08:12 AM   #8
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,401
Quote:
Originally Posted by cardosocea View Post
Doesn't this put you in a similar situation highlighted by Peter N.? Though with a small chance of happening?
Not at all - the bits have to keep toggling, because of the XIO inversion in one PLC - either will do.

It can't get synchronous, because there's no inherent timer. If the bits stop toggling, the message instructions aren't working, for whatever reason - eg. PLC Died, in Program Mode, Powered Down, etc., or the comms system is "broken" in some way.
__________________
___________________________
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 February 26th, 2018, 09:36 AM   #9
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,253
Daba - that was my standard also for precisely the same reasons. Each end had two timers one enabled by the on condition and the other by the off condition. Preset of each to a reasonable time, 2 seconds for example. If either times out the communications have stopped.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com

Last edited by bernie_carlton; February 26th, 2018 at 09:39 AM.
  Reply With Quote
Old February 26th, 2018, 10:10 AM   #10
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,110
Quote:
Originally Posted by daba View Post
Not at all - the bits have to keep toggling, because of the XIO inversion in one PLC - either will do.

It can't get synchronous, because there's no inherent timer. If the bits stop toggling, the message instructions aren't working, for whatever reason - eg. PLC Died, in Program Mode, Powered Down, etc., or the comms system is "broken" in some way.
In my limited knowledge of Rockwell stuff and how the data update works, it is possible that the data is updated and the code hasn't run... unlike situations where the data is read at the beginning of the cycle and written at the end.
Obviously these would be quite limited and you had to go out of your way to make it happen, but there's a potential for it, no?

Or am I completely wrong?
  Reply With Quote
Old February 26th, 2018, 10:13 AM   #11
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,401
Quote:
Originally Posted by bernie_carlton View Post
Daba - that was my standard also for precisely the same reasons. Each end had two timers one enabled by the on condition and the other by the off condition. Preset of each to a reasonable time, 2 seconds for example. If either times out the communications have stopped.
I economised, and only had 1 permanently-enabled timer in each PLC. I used one-shots to reset it on the rising and falling edges of the handshake bit.

I also got caught out by the "square-wave" handshake bit, (not my programming, I must say), which started to go awry when additional comms blocks were added to an old system.

It altered the comms rate of the blocks where the "handshake bits" were, and they became synchronous to the period it was inspected in the partner PLC.

Not wanting to store up a future occurrence if things got changed again, I ripped it all out, and came up with the "inverted cyclic bit". Started using this method of comms checking around 1988 or thereabouts. I never did give it a name, but I suppose "Inverted Cyclic Bit" is as good as any....
__________________
___________________________
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 February 26th, 2018, 10:25 AM   #12
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,401
Quote:
Originally Posted by cardosocea View Post
In my limited knowledge of Rockwell stuff and how the data update works, it is possible that the data is updated and the code hasn't run... unlike situations where the data is read at the beginning of the cycle and written at the end.
Obviously these would be quite limited and you had to go out of your way to make it happen, but there's a potential for it, no?

Or am I completely wrong?
The comms has to work, AND the code must be executed in both PLCs for them to toggle on and off, irrespective of data update times or anything else.

I have put that exact methodology in all projects I have done for many years, and haven't had a single failure.

It is the simplest and most efficient way to ensure everything is working as it should....

EDIT : It passed every single "failure-mode" test our various clients threw at it in their "Factory Acceptance Tests"
__________________
___________________________
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; February 26th, 2018 at 10:29 AM.
  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
make a pulse generator for RSlogix500 duckman LIVE PLC Questions And Answers 5 March 10th, 2014 01:11 PM
Convert pulse to square wave Manglemender LIVE PLC Questions And Answers 7 August 8th, 2013 05:42 AM
Red Lion pulse generator help vin7102 LIVE PLC Questions And Answers 7 January 30th, 2013 11:40 PM
Signal converter: Sinusoidal 1Vpp to square wave krk LIVE PLC Questions And Answers 2 March 17th, 2010 08:24 AM
Off Topic: Period/Frequency/Impedance of square wave vs sine wave plc_user1973 LIVE PLC Questions And Answers 12 February 8th, 2008 02:18 PM


All times are GMT -5. The time now is 05:01 PM.


.