fg71
One of the reason Siemens LOGO is used for electrician to do simple task efficient.
Take this example that is very common in staircase for apartment or house.
We like to switch ON/OFF a light from floor 1, floor 2 and floor 3
Extra is a timer that switch OFF the light after some time to save energy.
 
I like you to visual this layout in FBD and only see the 7 rectangle. Do you see the pattern?.
The top horizontal rectangle is floor 1... and the bottom is floor 3.
The vertical rectangle show from left to right, input, logic (XOR), timer (TOF) and output.
 
Its very common to layout FBD this way and it will be much easier to maintain. The reason I like FBD and
do everything in FBD in Siemens LOGO its far more easier to understand and Ladder Diagram.  
 
[203128%2F9109047%2Fmceclip0]
Reply 0 0
thiagoralves
OpenPLC also supports FBD! 😉
Reply 0 0
fg71
Sure 😉, I do my prototypes in Siemens LOGO to save time....
 
[203128%2F9109163%2Fmceclip0]
Reply 0 0
clintux
Why do you need the XOR instructions?
Reply 0 0
fg71
Let say you are not using a timer and use normal switch. You are on floor 3 and switch the light ON, next you go down to floor 1 and now you like to switch the light OFF. That is only possible if you use XOR. Other way to see it.... the switch has 2 state ON or OFF. Any switch doesn't not know the state of a light. So when you switch ON a light on floor 3 and go down to floor 1 and try to switch it OFF it doesn't work when the switch close the contact. So you couldn't make the switch to be parallell or serie. The switch on floor 3 is still ON so you need other logic to make it work.
 
Of course there are special switches to do this without PLC logic but it also increase the amount of cables you need.
 
One of the reason to use PLC logic is to use less cables to do the logic with switches. Take KNX system that use 2 cables with power and send
telegram on the bus. The reason to use that system you do not need lot of cables to make it work.
 
In XOR instruction
 
A | B | OUT
0 | 0 | 0
1 | 0 | 1
0 | 1 | 1
1 | 1 | 0
 
The good thing about using XOR its very easy to extend it if we like to build something for 5, 7 or any number of floor. Any person could switch the light ON for any floor no matter if the switch is ON or OFF.
 
Lets say we are building a function that use SET/RESET and have 5 switch that could set the light ON. Now you also need 5 switch to reset it to switch the light OFF. That is lot of cables and very expensive installation. So you need less amount of cables if you use XOR in your installation.
Reply 1 0
clintux
Yes I understand all that but the TOF made it not work like that, so hence my confusion.
Reply 0 0
fg71
You have to use momentary switch if you use TOF then you could use OR instruction.
But if you remove the TOF it will break, and you couldn't use normal switch in OR instruction.
 
I could agree that its possible to use momentary switch with OR instruction and TOF but that is the only option.
XOR could be used with normal switch or momentary switch and TOF or without TOF we need normal switch.
 
If you decide OR instruction instead of XOR you also make your logic limited compare to XOR.
Reply 0 0
fg71
Yes I understand all that but the TOF made it not work like that, so hence my confusion.
OpenPLC do not have momentary simulator switch in other words send a puls to TOF to set the state to output to true.
The simulator only have a normal switch that a user need to set and unset meaning 2 x press of the button.
 
I use Siemens LOGO and I could simulate a momentary switch. In other words I could simulate many different behavior in the simulator.
Reply 0 0
clintux
OpenPLC editors FBD implementation is more like CFC which makes it way more flexible than standard IEC FBD. I hope the new editor keeps that flexibility.
FYI for anybody unfamiliar with IL, LD and FBD the latter two are simply different implementations of a graphical representation of IL.
In fact some IDEs will let you toggle between all three seamlessly.
Reply 0 0
Grz
OpenPLC n'a pas de commutateur de simulateur momentané, en d'autres termes, envoie une impulsion à TOF pour définir l'état de sortie sur vrai.
Le simulateur ne dispose que d'un interrupteur normal qu'un utilisateur doit activer et désactiver, ce qui signifie appuyer 2 fois sur le bouton.
 
J'utilise Siemens LOGO et je pourrais simuler un interrupteur momentané. En d’autres termes, je pourrais simuler de nombreux comportements différents dans le simulateur.
Hello fg71,
Perhaps you can see some POU for lighting device :
Best regard
Pierre
Reply 1 0
fg71
Thanks for sharing, I will check your logic and will properly learn something.
 
@clintux Tia Portal have CFC and it force a user to layout the blocks in correct way. Other point could be that memory flag could be state of a output. If we define physical output block we do not use this as input to other blocks. If we are not cleat it could be very messy logic.
Reply 0 0
fg71
 
Did you know that this is the Ladder Diagram for XOR block in FBD, I remember that when I did a switch with 3 button.
I remove the OUT coil and use memory flag and include third switch with logic with memory flag.
Its XOR in Ladder Diagram with 3 switch button.
 
[203128%2F9111574%2Fmceclip0]
 
Here is fast prototype in Siemens LOGO of Ladder Diagram (XOR) with 3 switch buttons
 
[203128%2F9111592%2Fmceclip0]
 
Here is your version 😉
 
[203128%2F9111606%2Fmceclip0]
Reply 1 0
fg71
The XOR instruction take 2 input and 1 output. If you connect the output to other XOR you have 3 input.
It means in Ladder Diagram you need to add other rung to build your third input. And if you repeat that
you could have as many input you like the logic will be the same.
Reply 2 0
Reply