LOGO! challenges: basic functions 1-10

plc
logo
boolean-logic

(Community & PR manager) #1

Hello 0x00sec. I introduced you to the LOGO micro-PLC earlier, and I promised that I would give exercises and challenges for 0x00sec so you can learn hands-on PLC programming. I already have 38 exercises ready and I will gradually release them, while I work on making other exercises. Right now I am designing a stuxnet-like exercise for the future.

The first 20 exercises I got are meant to teach you guys how to use the basic functions of LOGO (like the AND, OR, NOT, XOR…) in a hands-on way. This is pure boolean logic and considering most of you here know what that is, these exercises should be a breeze.


Requirements

  • You have LOGO Soft installed, you can download the demo version (which is enough for us) from here.

Here’s a list of manuals you might need:


How to solve a challenge

  • You must take a screenshot of the program you made in LOGO Soft. A screen recording of you running the simulation is also accepted.

  • Then you must write down how your program works. Example: “If I1 is active, then it will activate the 1st pin on the AND-gate called B001. If I2 is also active, which is connected to the 2nd pin of B001, then B001 will be active.”

  • You must write a short report of how you came to the solution if you used any of the manuals or help menus. If the solution was so easy you didn’t need any of the manuals or help menus, you can skip this step.

Your solution is ONLY valid if you have done all of the above!!

Solutions must ALWAYS be blurred using the “blur spoiler” tool!


Challenge 1

Description: When I1 is active (1), Q1 must be active (1). When I1 is not active (0), Q1 also becomes inactive (0).

Rules of Engagement:

  • ONLY basic functions (AND, OR, NOT…)

Author assigned level: Total Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 2

Description: I1 and I2 need to be active at the same time in order for Q1 to be active.

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 3

Description: Q1 turns on when either I1, I2, or I3 is active.

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 4

Description: I1, I2, and I3 need to be active together in order for Q1 to be active.

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 5

Description: When I1, I2, I3, and I4 are all active at the same time, Q1 will be active.

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 6

Description: If I1 and I3 or I2 and I4 are active at the same time, then Q1 will be active.

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 7

Description: When I1 and I3, or I2 and I4 are active, then Q1 will be active and Q2 will be inactive.

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 8

Description: The output Q1 will be inactive when I1 or I2 or I3 is active.

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 9

Description: If I1 or I2 or I3 or I4 is active, then Q1 will be active

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Challenge 10

Description: If I1 and I2 are active at the same time, or I3 is active, then Q1 will be active.

Rules of Engagement:

  • ONLY basic functions

Author assigned level: Newbie

Community assigned level:

  • Newbie
  • Wannabe
  • Hacker
  • Wizard
  • Guru

0 voters


Conclusion

That’s all, folks! I hope you enjoy this very simple set of exercises. Trust me when I tell you that more complex exercises are on their way. In the meantime, have fun solving these 10 challenges. I am looking forward to see everyone’s solution :grin:


#2
Solutions

I didn’t use any of the documentation. I found stuff by looking in the folders in the bottom left.

1


I1 is connected directly to Q1, so Q1 will be active when I1 is.

2


If I1 is active, then it will activate the 1st pin on the AND-gate called B001. If I2 is also active, which is connected to the 4th pin of B001, then B001 will be active. B001 is connected to Q1 so when B001 is active Q1 will be active.

3


Since all the other questions use I, I assume S was a typo and not intended to mean shift register bits?
I1 is connected to the first pin of the OR-gate called B001 if it is active then B001 will be. I2 is connected to the second pin of B001 so if it is active then B001 will be. I3 is connected to the 3rd pin of B001 so if it is active B001 will be. B001 is connected to Q1 so if it is active Q1 will be.

4


I1 is connected to the first pin of the AND-gate called B001. If I2 and I3 are also active, which are connected to pins 2 and 3 of B001 then B001 will be active. If B001 is active then then Q1 will be active.

5


I1 is connected to the first pin of the AND-gate called B001. If I2, I3, and I4 are also active, which are connected to pins 2, 3, and 4 of B001 then B001 will be active. If B001 is active then then Q1 will be active.

6


I1 and I3 are connected to pins 1 and 4 of the AND-gate B001. If both of them are active B001 will be active. B001 Is connected to pin 1 of OR-gate B003 so if B001 is active, B003 will be. I2 and I4 are connected to pins 1 and 4 of AND-gate B002. If both of them are active B002 will be. B002 Is connected to pin 4 of B003 so if B002 is active, B003 will be. Q1 will be active when B003 is.

7


I1 and I3 are connected to pins 1 and 4 of the AND-gate B001. If both of them are active B001 will be active. B001 Is connected to pin 1 of OR-gate B003 so if B001 is active, B003 will be. I2 and I4 are connected to pins 1 and 4 of AND-gate B002. If both of them are active B002 will be. B002 Is connected to pin 4 of B003 so if B002 is active, B003 will be. Q1 will be active when B003 is. B003 is connected to NOT-gate B004, so if B003 is active B004 will be inactive. Q2 is inactive when B004 is.

8


I1, I2 and I3 are connected to pins 1,2, and 4 of OR-gate B003 so B003 will be active when any combination of them are. B003 is connected to NOT-gate B001 so B001 will be inactive when B003 is. Q1 will be inactive when B001 is.

9


I1, I2, I3 and I4 are connected to pins 1, 2, 3, and 4 of OR-gate B003, so B003 will be active when any combination of them are. Q1 will be active when B003 is.

10


I1 and I2 are connected to pins 1 and 4 of AND-gate B001, so B001 will be active when they both are. B001 is connected to pin 1 of OR-gate B003 so B003 will be active when B001 is. I3 is connected to pin 4 of B003, so B003 will also be active when I3 is. B003 is connected to Q1 so Q1 will be active when B003 is.


(Community & PR manager) #3

Great solutions, I’m pleased to say they’re all correct :clap:

And yes, exercise 3 was a typo. The reason I made this typo is that I have hardware schematics available for these challenges too in case someone doesn’t understand the situation, and there I put a switch on my inputs, called “S1, S2…”, so I got them mixed up :laughing:


#4

I just went straight forward without any documentation.

Summary


I1 is directly connected to Q1, so when it is active, Q1 will be also.


I1 and I2 are connected to pins 2 and 3 of the AND gate, so when both are active, Q1 will be to.


I1, I2 and I3 are connected to pins 1, 3 and 4 of the OR gate, so when one of them is active, Q1 will be also.


I1, I2 and I3 are connected to pins 1, 3 and 4 of the AND gate, so when all of them are active, Q1 will be to.


I1, I2, I3 and I4 are connected to pins 1, 2, 3 and 4 of the AND gate, so when all of them are active Q1 will be also.


I1 and I3 are connected to pins 1,4 of the AND gate, I2 and I4 are connected to pins 1, 4 of the AND gate.
Then both of the AND gates are connected to pins 1, 4 of the OR gate, so when I1 and I3 or I2 and I4 are active the Q1 will be to.


I1 and I3 are connected to pins 1,4 of the AND gate, I2 and I4 are connected to pins 1, 4 of the AND gate.
Both of the AND gates are connected to pins 1, 4 of the OR gate which is connected to pin 1 of the Q1 and to pin 1 on the NOT gate, which is connected to the Q2. So when I1 and I3 or I2 and I4 are active, Q1 will be active and Q2 will be inactive.


I1, I2 and I3 are connected to pins 1, 2 and 4 of the OR gate. Then the OR gate is connected to the NOT gate which is connected to the Q1. So when I1, I2 or I3 are active Q1 will be inactive.


I1, I2, I3 and I4 are connected to the pins 1, 2, 3 and 4 of the OR gate, which is connected to Q1. So when I1, or I2 or I3 or I4 is active the Q1 will be also.


I1 and I2 are connected to pins 1, 4 of the AND gate, which is connected to pin 2 of the OR gate and I3 is connected also at the OR gate to the 4th pin. The OR gate being connected to the Q1. So when I1 and I2 are active or I3 is active, the Q1 will be to.

Those challenges are very good for people who want to learn the basic boolean operations, but I’m really interested in the challenges that will be next.
Anyway, they we’re still fun, and looking forward for the new ones. Good Job ! :laughing:


(Guess, there's a solution I'm not seeing.) #5

Thanks for coming up with those challenges.
Hopefully I have enough time for the following ones in the next weeks.
I haven’t used any documentation as well and was kinda sloppy with my descriptions (I will be more precise when the problems get more complex, I swear :crossed_fingers:)
@404Err0r @lkw Guys, I beg you, put your solutions in the “hide detail”-spoiler. My forefinger is bleeding.

Solutions

1| l1 and Q1 have a straight connection. Turning l1 on turns Q1 on.
logo1

2| l1 & l2 are connected to B001. The AND gate (B001) won’t activate Q1 until l1 and l2 are active.
logo2

3| l1, l2, l3 are connected to B001 (OR-Gate). Q1 will be lit by B001, if one of the L’s is active.
logo3

4| Like challenge 2 but with 3 L’s.
logo4

5| Like 4 but with 4 L’s.
logo5

6| B003 will activate Q1, if either B001 or B002 are active. B001 and B002 will be active, if both their respective L’s are active.
logo6

7| Well, It is basically like challenge 6. But in order to solve your challenge, it would be possible to place a Q2 somewhere there and not connect it. This should be a valid solution because Q2 wont be active; like… never; right?
:stuck_out_tongue:
Anyway, Q2 is connected to B004 which will activate it, when B003 isn’t. Therefor it is never active, when Q1 is active and vise versa.
logo7

8| l1, l2, l3 are connected to B001 (NOR-Gate), which won’t activate Q1 until all of the L’s are deactivated.
logo8

9|

Summary

It’s like challenge 3 but with 4 switches.

10|

Summary

B002 will only activate Q1, if B001 or l3 are active. B001 in turn will be active, when l1 and l2 are active together.


(Community & PR manager) #6

The reason why I want you to write descriptions for now is to make sure you understand what you’re doing. Understanding what we are doing is what separates us from the skids :wink:


#7

Thanks for the advice, I’ll do that in future (This was my first time using a spoiler :stuck_out_tongue: )