Version Control and Deployment Strategy for Large PLCnext Fleet with GitLab

Hello, :waving_hand:

I am working with PLCnext controllers using PLCnext Engineer (Structured Text only, no high-level languages). I manage multiple workshops, each containing several production lines. One project can run on up to 9 lines within the same workshop. At any given time, only some lines may be active (for example 4 of 9 today, 8 of 9 tomorrow).

I use Git (self-hosted GitLab) for version control. I have:

  • Project source files
  • Hash of the compiled project
  • Hash of the project deployed on each controller

The complexity:

  • The same project branch may be deployed to 3 PLCs
  • Another branch of the same project may be deployed to 5 other PLCs
  • Different workshops may run different branches simultaneously
  • Controllers go online/offline dynamically

Main challenges:

  1. How to structure Git branches for such a deployment model?

  2. How to automate deployment and traceability when different PLCs run different branches?

  3. What is the recommended way to identify exactly which project version is deployed on a specific PLC when managing a large fleet?

  4. How to reliably link:

    • Git commit
    • Compiled binary
    • Hash/version on PLC
    • Physical controller/line/workshop

Since I am using ST inside PLCnext Engineer, not C++ or other high-level components, I do not have typical software versioning mechanisms available inside the runtime.

I am ready to implement a custom microservice (in any programming language) to handle deployment, version tracking, controller registry, or other orchestration tasks if that is considered a proper architectural approach.

What is the recommended architecture for:

  • Version tagging
  • Branch strategy
  • Deployment automation
  • Version visibility directly on the PLC
  • Fleet-level traceability

How do experienced PLCnext users handle large-scale controller fleets with multiple parallel branches in production?

Any architectural guidance or real-world practice examples would be appreciated.

I am using a git hook to write the commit hash to a data type file which is then read and displayed as a variable in real time.
That data type file is obviously in the .gitignore, but otherwise it is quite straight forward.

1 Like

We have a β€œfleet” of 100s of PLCs in the field in very different configurations and with very different missions. We decided the following strategy β€”

  • we have one universal runtime
  • on 1st start the PLC connects to the backend via mqtt, sends its UUID and basically asks β€œwho am I?”
  • the backend sends mqtt commands, which either configure the PLC so that it knows what to do or are passed on to devices the PLC controls
  • this way we have one very stable runtime and the control programs are in the backend; the reaction times can be as fast as 100ms
1 Like