Boolean Logic to PLC Function Blocks | Fundamentals

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ส.ค. 2024
  • ▶ C'mon over to realpars.com where you can learn PLC programming faster and easier than you ever thought possible!
    =============================
    ▶ Check out the full blog post over at
    realpars.com/boolean-logic/
    =============================
    ⌚Timestamps:
    00:00 - Intro
    00:49 - Boolean logic
    01:44 - Basic Function Blocks
    02:07 - OR Function Block
    03:12 - AND Function Block
    03:51 - Boolean logic FBD optimization
    =============================
    Have you ever wondered how skilled PLC Programmers create, install and test programs when presented with complex system requirements?
    Today’s successful PLC programmers possess knowledge and skills in electrical, mechanical, and software engineering.
    In addition to having expert-level skills in vendor-specific PLC programming software, PLC programmers rely on Boolean Logic and mathematical concepts to optimize their designs.
    In this video, we’re going to have a look at some basic mathematical concepts that are used to create Function Block programs.
    Earlier we said that PLC programmers rely on mathematical concepts to optimize their designs. PLC programmers use Boolean Algebra, also called Boolean Logic every time they create a program.
    Boolean Logic centers around the fundamental concept that all values are either True or False. Going one step further, True and False can be represented by either a 1 bit or a 0 bit.
    You’ve likely noticed that most PLC programming languages use the term BOOL to represent a digital input or output. BOOL is short for Boolean. Every digital I/O can be represented by a 1 or a 0.
    Function Block Diagram (FBD) as described in IEC 61131-3 is rapidly replacing Ladder Logic as the programming language of choice amongst PLC programmers.
    Let’s look at the two basic Function Blocks in FBD and investigate the Boolean Algebra associated with each.
    1) The OR Function Block has at least two inputs.
    Earlier we said in Boolean Logic, all values are either True or False and can be represented by either a 1 or a 0 bit.
    The OR Function Block has a Truth Table that does two things. First of all, it lays out all of the possible input conditions. Secondly, it indicates how the output reacts to the input conditions.
    From the Truth Table, we can see that the C is True when A OR B is True
    OK… Here’s where we get into the Boolean Algebra part. The mathematical expression for the OR function block is A OR B equals C. A plus sign is used to indicate the OR function.
    In primary school, we were taught that the plus sign is used for addition. So… it would appear that the OR function block performs Boolean addition!
    2) The AND Function Block has at least two inputs.
    From the AND Truth Table, we can see that C is True when A AND B are True.
    The mathematical expression for the AND function block is A AND B equals C. Notice the multiplication symbol used to indicate the AND function. So, it would appear that the AND function block performs Boolean multiplication!
    Let’s look at a simple example of Boolean Logic optimization.
    On the first pass of converting a system requirement into a FUNCTION BLOCK DIAGRAM, a programmer ended with three function blocks.
    The programmer would ask herself… Can I optimize this FUNCTION BLOCK DIAGRAM and eliminate any of the function blocks using Boolean Algebra?
    The answer is Yes. So, let’s see how.
    The Boolean Logic expression for the program is: D=AB+AC
    Using a little high school math, we use the Distributive Law and a transformation occurs: D=A(B+C)
    After using some basic algebra, we’ve gone from three function blocks to two function blocks.
    =============================
    To learn more, you might want to review our other articles:
    What is a Control or Function Block? realpars.com/function-block
    What is the Difference between Ladder Logic and Function Block Diagrams? realpars.com/ladder-logic-vs-...
    =============================
    Missed our most recent videos? Watch them here:
    realpars.com/plcnext-engineer/
    realpars.com/sinking-and-sour...
    realpars.com/turbine-flow-meter
    =============================
    To stay up to date with our last videos, make sure to subscribe to this TH-cam channel:
    bit.ly/realpars
    =============================
    TWEET THIS VIDEO ctt.ac/OoWdx
    =============================
    Follow us on Facebook: / therealpars
    Follow us on Twitter: / realpars
    Follow us on LinkedIn / realpars
    Follow us on Instagram / realparsdotcom
    #RealPars #PLCprogramming #automationengineer

ความคิดเห็น • 56

  • @ziadzakaria8206
    @ziadzakaria8206 3 ปีที่แล้ว +4

    I really appreciate the time and effort that you put to make these videos look like this.
    Thank you very much.

    • @realpars
      @realpars  3 ปีที่แล้ว

      Glad you like them!

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @ricardogarcia3900
    @ricardogarcia3900 3 ปีที่แล้ว

    Congrats. I love this channel. Since the basics until the complex. Easily explained. Grettigns from Venezuela.

    • @realpars
      @realpars  3 ปีที่แล้ว

      Thank you very much, Ricardo!

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @bharatkumarchittala7396
    @bharatkumarchittala7396 3 ปีที่แล้ว +1

    Your way of explanation it's really amazing👌

    • @realpars
      @realpars  3 ปีที่แล้ว

      Thanks a lot 😊

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @johnlansing2902
    @johnlansing2902 3 ปีที่แล้ว +2

    I deeply wish that your videos could be used as a introduction to the industry in order to give an alternative education path to high school students.

    • @realpars
      @realpars  3 ปีที่แล้ว

      What an amazing compliment, John! We would truly appreciate that. Hopefully, students can still find our video courses without difficulty and help them during their study.
      Thanks a million for your kind support!

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @ahmadshafique8453
    @ahmadshafique8453 3 ปีที่แล้ว +1

    Very good teach sir thanks all team

    • @realpars
      @realpars  3 ปีที่แล้ว

      Thank you, Ahmad!

  • @andreyace8768
    @andreyace8768 3 ปีที่แล้ว

    Thank you very much!!!

    • @realpars
      @realpars  3 ปีที่แล้ว

      You're welcome!

  • @dennisrubio2375
    @dennisrubio2375 2 ปีที่แล้ว

    Thank you Sr

    • @realpars
      @realpars  2 ปีที่แล้ว

      You're very welcome!

  • @user-zf6lv7dq3x
    @user-zf6lv7dq3x 3 ปีที่แล้ว

    Hi guys, I enjoy a lot of your work, and actually it's helps me a lot in my professional life, thanks!
    I would suggest to you one topic for next video. What do you think about if make video (or cycle of video) about siemens STL language? Basics of STL, in which case it should to be used, how transform it in LAD a d FBD, what to do when TIA portal can't do that conversion?
    Put like if you like that idea 😉

    • @realpars
      @realpars  3 ปีที่แล้ว

      Hey!
      Thanks a million for your kind comment and your suggestions. I will happily pass this on to our course developers!
      Thanks for sharing and happy learning!

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @montheralkalbani7816
    @montheralkalbani7816 3 ปีที่แล้ว +1

    Thank you very much. Can you please make a video about Yokogawa’s DCS?

    • @realpars
      @realpars  3 ปีที่แล้ว +2

      Hi Monther!
      Thanks for your comment and your suggestion. I will pass this on to our course developers!
      Thanks for sharing and happy learning!

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @vanduypham6731
    @vanduypham6731 3 ปีที่แล้ว

    thank you so much

    • @realpars
      @realpars  3 ปีที่แล้ว

      You're welcome!

  • @zamnangzen1519
    @zamnangzen1519 3 ปีที่แล้ว

    nice knowledge

  • @jorgecepeda4498
    @jorgecepeda4498 3 ปีที่แล้ว

    Axolubtelly perfect. Excellent vídeo.

    • @realpars
      @realpars  3 ปีที่แล้ว +1

      Thank you very much!

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @chrisvise9374
    @chrisvise9374 2 ปีที่แล้ว

    It appears that you could solve the problem with standard math. For the or the input has to be greater or equal to 1. If your had both inputs true then they would equal 2 which is greater than one making your output 1. Also the and being multiplication would also work with standard math. 1 x 0 equals zero. 0 x 1 equals zero. Only when both values are true 1 x 1 will your it register as true. 1 x 1 equals 1. Great content! Just thought i would point this out.

    • @realpars
      @realpars  2 ปีที่แล้ว +1

      Hi @Chris Vise. Thanks for your comments. You are correct about the AND function block performing “multiplication”. I’m a bit confused about the OR comments. You mention that when both inputs are True, the output is 2. In Boolean Algebra there is no “2”. Only “0” and “1”. As you know, there are many math functions in PLC programming but they are at the word level containing multiple Bools, or bits. We need at least 2 bits to get our number “2” which is “10”. Thanks again for your feedback. We look forward to hearing from you again!

  • @sinditshabalala6376
    @sinditshabalala6376 3 ปีที่แล้ว

    1. By considering the ISO Model which layers collect various functions that provide useful interfaces between software applications and the network layer?

    • @realpars
      @realpars  3 ปีที่แล้ว

      Hi Sindi. I’m not sure I understand your question. Can you elaborate please? As you may know, the IEC 61131-3 is a standard with five programming languages - 2 text-based and 3 graphical languages with a possibility of C language as a hosted function block in the graphical languages.

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @cck0728
    @cck0728 3 ปีที่แล้ว

    Excellent. So does it mean new beginners should focus more on "functional block" rather than "ladder logic"?
    Thanks for your excellent work.

    • @realpars
      @realpars  3 ปีที่แล้ว +1

      That's a good question, and not easy to answer. Ladder Logic is not about to disappear any time soon. Lots of PLC programs currently in use were created in Ladder Logic therefore anybody involved must be able to understand how to navigate. But, lots of new PLC programs are being written in FB and other IEC6113-3 languages.

    • @cck0728
      @cck0728 3 ปีที่แล้ว

      @@realpars Thanks for your kind reply.

  • @fajarrukmo
    @fajarrukmo 3 ปีที่แล้ว

    please make video about State Based Control

    • @realpars
      @realpars  3 ปีที่แล้ว +1

      Hey!
      Thanks for your comment and your suggestion. I will pass this on to our course developers!
      Thanks for sharing and happy learning!

  • @vinodkumarvinu5441
    @vinodkumarvinu5441 3 ปีที่แล้ว

    Please make a video about micro controller configuration

    • @realpars
      @realpars  3 ปีที่แล้ว

      Thanks for the topic suggestion, I will definitely go ahead and forward this to our creator team. Happy learning!

  • @IamBernI
    @IamBernI 3 ปีที่แล้ว

    Good video.
    But do you really see as you say "FBD rapidly replacing ladder logic" on field?

    • @realpars
      @realpars  3 ปีที่แล้ว +1

      Hi Bernanrdo. Thanks for your question. The comment "FBD rapidly replacing ladder logic" is based on recent experiences while working with various industrial clients over the last 5 to 10 years. For almost every client, any new installations with PLC automation was accompanied by FB programs, not Ladder Logic programs.

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @rajasekar206
    @rajasekar206 3 ปีที่แล้ว

    Please more explanation in FBD...

    • @realpars
      @realpars  3 ปีที่แล้ว +2

      Thanks for your feedback and suggestion, Rajasekar!

  • @charliechimples
    @charliechimples 3 ปีที่แล้ว

    Great vid thanks for sharing. 🐵

    • @realpars
      @realpars  3 ปีที่แล้ว

      Our pleasure!

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @kiranchoudhari4717
    @kiranchoudhari4717 3 ปีที่แล้ว

    Good

  • @ElektrikaCo
    @ElektrikaCo 3 ปีที่แล้ว

    What makes function blocks superior to ladder logic?

    • @realpars
      @realpars  3 ปีที่แล้ว +1

      For many programmers, FB programming is much easier than Ladder Logic. Although there are standard Functions Blocks including timers and counters, more sophisticated blocks can be created to perform a logical operation that requires several ladder logic instructions.

    • @stevenlee5755
      @stevenlee5755 3 ปีที่แล้ว

      Do you need PLC or any other products ?We can offer: industrial products like Module, PLC, LCD panel,HMI,VFD,CNC spindle,CNC accessories,servo system, stepper system etc.

  • @jacobbergmann6763
    @jacobbergmann6763 3 ปีที่แล้ว

    Please upload the video with German subtitles

    • @realpars
      @realpars  3 ปีที่แล้ว +1

      Hi Jacob,
      Thanks for your comment! We currently only provide our course videos in English, you are always able to turn on the English subtitles as that might make it a bit easier for you.
      Our apologies for any inconvenience!
      Happy learning!