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.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old April 2nd, 2021, 12:30 AM   #1
greenlantern
Member
United States

greenlantern is offline
 
Join Date: Apr 2021
Location: tx
Posts: 4
Book Basic PLC question that challenges the best:

Create ladder logic program to count 4 on pulses (not using a counter) and then turn the output on if the on pulse input signal can look like the following:
Attached Images
File Type: jpg image001.jpg (98.9 KB, 332 views)

Last edited by greenlantern; April 2nd, 2021 at 12:36 AM.
  Reply With Quote
Old April 2nd, 2021, 05:10 AM   #2
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 3,084
Welcome to the forum, I think you would be best to post this in the main Q&A, however, a few questions. It says must be on for 50ms but it also says can go on/off between those times, this does not make real sense. if it is on for 50ms and off for 100ms no problem but like the drawing the second pulse is switching on/off multiple time is this going to be classed as an on pulse ?.
I think there is room for clarity, for example:
50ms pulse is classed as a count and a multiple pulse within 50ms is also classed as 1 count, or is the second multiple pulse not counted because it is not on for a min of 50ms.
  Reply With Quote
Old April 2nd, 2021, 10:18 PM   #3
greenlantern
Member
United States

greenlantern is offline
 
Join Date: Apr 2021
Location: tx
Posts: 4
Quote:
Originally Posted by parky View Post
Welcome to the forum, I think you would be best to post this in the main Q&A, however, a few questions. It says must be on for 50ms but it also says can go on/off between those times, this does not make real sense. if it is on for 50ms and off for 100ms no problem but like the drawing the second pulse is switching on/off multiple time is this going to be classed as an on pulse ?.
I think there is room for clarity, for example:
50ms pulse is classed as a count and a multiple pulse within 50ms is also classed as 1 count, or is the second multiple pulse not counted because it is not on for a min of 50ms.
Some clarification: The on-time signal will come in at 40-60ms not less than 40ms and no more than 60ms. Therefore just count the on-time signal(1's) that have time lengths between 40-60ms and ignore any other. Then when your program logic counts to four pulses(1's) then turn output on between 50-100ms.
  Reply With Quote
Old April 2nd, 2021, 11:28 PM   #4
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,587
xxx.png
  Reply With Quote
Old April 3rd, 2021, 07:31 AM   #5
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,587
Quote:
Originally Posted by drbitboy View Post
...

Assumptions
  1. "40-60ms" means valid input pulses are 1 continuously for at least 40ms and for no more than 60ms
    1. If the input is 1 on two successive scans, then it is assumed that it was on continuously between those two scans.
  2. The output comes on immediately after the fourth 40-60ms pulse (as defined above) returns to 0, and the output stays on for ~75ms (which is between 50ms and 100ms).
Program description
  • S:35 is the duration of the previous scan, measured in periods of 0.1ms i.e. ticks of the 10kHz free-running clock.
  • So 400ticks (N7:4), 600ticks (N7:5), and 750ticks (N7:5) approximate 40ms, 60ms, and 75ms.
  • N7:0 is the duration of a continuous 1 value of discrete input I:0.0/0
    • The second branch of Rung 0002 MOVes a value of 0 into N7:0 on any scan where I:0.0/0 is 0
    • Rung 0001 increments N7:0 by the scan duration (S:35) on any scan where I:0.0/0 is 1 and N7:0 does not exceed 600 (60.0ms).
  • N7:1 is the number of valid input pulses detected.
    • The first branch of Rung 0002 detects the end of a valid pulse and increments N7:1
    • N.B. N7:0 can only be greater than 0 when input I:0.0/0 is 0 for one scan at a time.
    • N.B. N7:1 can only be 4 for one scan at a time.
  • Rung 0003 detects the scan when N7:1 is between 400-600ticks (40-60ms) and the input values changes from 1 to 0
    • I.e. the scan when the end of the fourth valid pulse is detected on Rung 0002.
    • Rung 0003 puts a value of 750 (ticks, equivalent to ~75ms) into N7:3
  • Rung 0004 detects when N7:3 is non-negative; when that is detected, Rung 0004 does two things
    • It assigns a 1 discrete output O:0.0/0
      • Otherwise (i.e. when N7:3 is negative) it assigns a 0 to the output
    • It decrements N7:3 by the scan duration (S:35)
  Reply With Quote
Old April 3rd, 2021, 09:37 AM   #6
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Leipzig, Germany
Posts: 1,231
Mr lantern, does a series of 5 pulses count as two 4pulse sequences?
How many ON outputs would you expect for an 8pulse sequence? 1? 2? or 5?
  Reply With Quote
Old April 3rd, 2021, 09:57 AM   #7
Phrog30
Member
United States

Phrog30 is offline
 
Join Date: Dec 2006
Location: Montgomery, Alabama
Posts: 781
Clever way to ask for homework help.
  Reply With Quote
Old April 3rd, 2021, 12:09 PM   #8
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,587
Quote:
Originally Posted by Phrog30 View Post
Clever way to ask for homework help.

yeah, pushed my buttons rather efficiently.
  Reply With Quote
Old April 3rd, 2021, 12:37 PM   #9
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Leipzig, Germany
Posts: 1,231
Quote:
Originally Posted by drbitboy View Post
yeah, pushed my buttons rather efficiently.
At least you didn't give them the right answer
  Reply With Quote
Old April 3rd, 2021, 01:07 PM   #10
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,587
Quote:
Originally Posted by AustralIan View Post
At least you didn't give them the right answer
  Reply With Quote
Old April 3rd, 2021, 02:39 PM   #11
jhenson29
Member
United States

jhenson29 is offline
 
Join Date: Mar 2021
Location: St. Louis, MO
Posts: 59
Done
Attached Images
File Type: png 0B4AE19B-F784-4112-97EC-387C3A662BB0.png (4.8 KB, 245 views)
  Reply With Quote
Old April 3rd, 2021, 03:15 PM   #12
swedeleaner
Member
Sweden

swedeleaner is offline
 
Join Date: Dec 2013
Location: GŲteborg
Posts: 102
Quote:
Originally Posted by jhenson29 View Post
Done
This is the correct answer.
What is this obsession with ladder logic anyway?

I get that IL translates well to LAD, but really canít see the point of ladder in 2020? As soon as you process anything other than bits, the ladder becomes obsolete?

Have you heard of FBD or ST?
  Reply With Quote
Old April 3rd, 2021, 03:25 PM   #13
jhenson29
Member
United States

jhenson29 is offline
 
Join Date: Mar 2021
Location: St. Louis, MO
Posts: 59
Quote:
Originally Posted by swedeleaner View Post
This is the correct answer.
What is this obsession with ladder logic anyway?

I get that IL translates well to LAD, but really canít see the point of ladder in 2020? As soon as you process anything other than bits, the ladder becomes obsolete?

Have you heard of FBD or ST?
Just the (vague...) resemblance to electrical schematics, and itís (maybe?) easier for non-programmers.

I prefer ST. Graphical languages are pretty much universally worse than text languages.

Also...we may have rolled over to 2021 now. I think it happened back around January.
  Reply With Quote
Old April 3rd, 2021, 03:29 PM   #14
I_Automation
Member
United States

I_Automation is offline
 
I_Automation's Avatar
 
Join Date: Jun 2020
Location: Detroit, Michigan USA
Posts: 531
Quote:
Originally Posted by jhenson29 View Post
Also...we may have rolled over to 2021 now. I think it happened back around January.

Not sure of the correct word, but "chronologically" speaking it is 2020 until 31 December 2029, then it's 2030 for about 10 years
  Reply With Quote
Old April 3rd, 2021, 03:36 PM   #15
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,587
Quote:
Originally Posted by swedeleaner View Post
What is this obsession with ladder logic anyway?


... ladder becomes obsolete?


... Have you heard of FBD or ST?


Haha very funny, such naivete. Please stop trolling.



I have a saying: "the only things I don't like about C (or Matlab or C# or Java or Javascript or Perl or Python or etc.) are their proponents." Do I really have to add as underpowered, arcane and boring a language as ST to that list?
  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
PLC basic question Karoly LIVE PLC Questions And Answers 2 June 2nd, 2012 11:16 PM
MPI comunication Manuel Raposo LIVE PLC Questions And Answers 22 July 16th, 2007 07:24 AM
[S5-155U CPU948]About PLC Communication Question. apple LIVE PLC Questions And Answers 2 July 20th, 2006 06:07 AM
plc5 with AB 1771-DB basic module, its urgent plz help me nileshsurya LIVE PLC Questions And Answers 6 July 20th, 2005 02:45 AM
Question re:PLC to PLC interaction. c0met LIVE PLC Questions And Answers 5 March 22nd, 2004 12:16 PM


All times are GMT -4. The time now is 11:28 AM.


.