seen
Hello,
 
First of all, thank you very much Thiago for this great piece of work!
 
I would like to know how to implement this example using version 4 of OpenPLC.
 
Thank you for your help.

Best regards,


Enzo

 
 
[203128%2F9370515%2Fmceclip0]
Reply 0 0
thiagoralves
  1. Click on the plus icon inside the "Create new rung" bubble at the middle of the screen to create a new rung
  2. Drag a contact from the left sidebar to the middle of the rung
  3. Type blink_led and click on "add variable"
  4. Double-click the "blink_led" contact and select "negated"
  5. Click on the magnifying glass icon next to Library on the left panel and type "ton"
  6. Drag the TON block in front of the blink_led contact
  7. Click on the magnifying glass icon next to Library on the left panel and type "tof"
  8. Drag the TOF block in front of the TON block
  9. Drag a coil from the left sidebar to the end of the rung
  10. Type "blink_led" on the contact variable
  11. Click on the (*TIME*) entry for both TON and TOF and type T#500ms (or any other time period you want)
  12. You're done!
Follow these steps and you will end up with something like this:
Screenshot 2025-06-26 at 10.26.11 AM.png
Reply 1 0
fg71
Good practice in plc programming is to separate logic from physical input and output.
In other words the example that include OpenPLC for blink_led. Use a pulse function there physical output also become a inverse input.
Good approach I think is to use memory adress for a logic to set a physical output. It makes it very clear what is logic output vs physical output.
 
Example would be, there the LED variable is a physical output
[203128%2F9374267%2Fmceclip0]
Reply 1 0
Reply