Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

sunset/sunrise switch outside lights

jpesout
2018-11-19
2020-05-06
  • jpesout - 2018-11-19

    Hi,

    I am trying to program outdoor lights, without a sensor, just switch on when it becomes dark.
    I am using the Calculate_SunriseSunset function block, based on longitudinal and latitudinal.
    this gives me the correct elevation and azimuth of the sun.

    How can I now use this to trigger my relays?
    And beside this, I also want to be able to swith them off/on manually.
    For all my other lights, I am using the FB_LatchingRelay to switch on/off the lights.

    Is all this possible using function blocks? Or do I need to program this myself in ST?
    (I think I cannot find the SunriseSunset calculation in ST)

    The basis idea is that my lights are switched on when it is dark enough outside and that I am able to switch them on/off manually, overriding the "dark enough" option.

    Can someone help me with this?

     
    • ahmed - 2020-05-06

      Hello,

      did you solve this?
      Im interested in conditions for day night in relation to angles?

      BR

       
  • jpesout - 2018-11-23

    Can this also be used with codesys 2.3? I am still using the old version for my PLC

     
  • Serhioromano - 2018-12-10

    jpesout hat geschrieben:
    Can this also be used with codesys 2.3? I am still using the old version for my PLC

    Yes it can. I used it fine.

     
  • fleaplc

    fleaplc - 2019-02-06

    FB (Oscat) is SUN_POS (Β§12.50). By this you can get the sun position : when Zenith < -0.8333 it means sunset is done (you can turn on the lights)

     

Log in to post a comment.