Check if Codesys runtime is on 'Running' or 'Stopped' state?

andre-luis
2024-07-02
2024-07-02
  • andre-luis

    andre-luis - 2024-07-02

    Hi there,

    I'm running the Codesys runtime on Windows 64 and I need to know if it is on "Running" or "Stopped" state just after a system crash. The following commands works perfectly well to (re)start it...

    net stop β€œCODESYS Control Win V3 - x64"
    net start β€œCODESYS Control Win V3 - x64"
    

    ...however I'm unable to determine when it is required to be call; I mean, by checking the System Tray icon, it is possible to know if it is on "Stopped" state, but I wanted to run a .BAT command to retrieve it.

    How can we do that?

     

    Last edit: andre-luis 2024-07-02
  • mos89p - 2024-07-02

    why not put it on windows startup ? to start at each start

     
  • andre-luis

    andre-luis - 2024-07-02

    It's already there, the service get started as default.
    I missed to say that sometimes it happens w/o even the system get restarted.

    Anyway, the main issue here is to know the state of the runtime. We collect a lot of informations about the whole system, and it would be nice to have a way to detect the runtime state.

     
  • andre-luis

    andre-luis - 2024-07-02

    Just to share, for those who as me are seeking for this and had found no information anywhere in this World: Every time I stop/start the PLC runtime ( turning into 'Stopped' or 'Running' state ) the 'CODESYSControlService' appears at the Taskmanager list, which could suggest a straight correlation.

    I was expecting a clever solution, but this one solves for while.

     

    Last edit: andre-luis 2024-07-02

Log in to post a comment.