Programming, coding tips for SCADA software; how to avoid failures

Many defects in software programming result from unneeded complexities, as explained at the 2025 ScadaFest by Trihedral, a Delta Group Co. See cost of failures. The 2026 ScadaFest is planned for March 23 to 27.

Programming tips for SCADA software insights

  • Evolution of industrial software programming has progressed from paper hand-written notes to more modern coding tools and workflows to improve accuracy, quality and schedules, according to Devraj Sen, CTO, and VTScada by Trihedral developer.
  • Leading causes of software defects include code, architecture and design.
  • Improve industrial programming by examining coding core principles and philosophies, among other industrial programming advice and jokes included below.

Software development life cycle processes matter for accuracy, quality and schedules, said Devraj Sen, CTO and VTScada by Trihedral developer. Sen explained programming, coding and configuring tips for mission critical industrial applications at the 2025 ScadaFest by Trihedral, a Delta Group Co. While the reference point is supervisory control and data acquisition (SCADA) software, the advice has applicability to other industrial software areas. Sen, who started with the company 25 years ago as a coop student, also is presenting at the 2026 ScadaFest by Trihedral, March 23 to 27.

Getting workflow procedures in order will help avoid paying for technical debt in the long term, Sen suggested. By focusing on the development team and workflow, it’s possible to retain quality and accelerate schedules. Learning from mistakes helps future efforts.

Sen, with experiences in services (writing code for products) and with the development team (writing code for projects), has merged the two areas. He meets with the assembled group, nearly 45 people, weekly using a collaborative approach. Integration of the two software groups resulted from the idea that developers working on product implementation and the developers working on products should know each other’s pain to address and integrate end-customer concerns more easily.

Evolution of industrial software programming

Sen’s experiences took him from binders and paper with hand-written notes to modern software development tools. Organic development can make coding fun, but attention is needed to avoid situations leading to frequent firefighting, when customers call with issues.

Customers remember when they call, and problems are solved, Sen said, advising that it’s important to prioritize support first, before developing the next feature.

[Question from Sen to the audience: Why do programmers prefer the dark mode? Answer: Because light attracts bugs.]

Figure 2: Leading root causes of software defects are code, architecture and design, said Devraj Sen, CTO and VTScada by Trihedral developer, citing data from Capers Jones, Quantifying Software, 20218 CRC Press. Sen is among presenters at the ScadaFest by Trihedral event. Courtesy: Mark T. Hoske, Control Engineering

Root causes of software defects: Code, architecture, design lead

Knowing the root causes of software defects (Figure 2) can help with time allocation and resolution. According to a 2018 study from Caper Jones, Quantifying Software, 2018 CRC Press, root causes of software defects are:

  • 27% code
  • 25% architecture and design
  • 17% requirements
  • 15% bad fixes
  • 10% documents
  • 6% security flaws.

Programmers should identify the real problem at hand, taking care to deliver the required solution versus the requested solution. Tracking failures is not to cast blame but to ensure errors are not repeated.

Sen outlined two notoriously expensive, high-profile bugs:

Mariner 1 Spacecraft in 1962 was lost when a hyphen was omitted in code sending incorrect guidance signals to the spacecraft, which required a self-destruct command 290 seconds after launch, a $169-million cost in today’s dollars ($18 million then).

A Mars Climate Orbiter in 1998 burned up because units were not converted from imperial units to metric, an error that took several months to find. Overall cost was more than $320 million.

[Question from Sen to the audience: Why was the statement scared while the comment was not? Answer: Because statements are executed.]

Coding core principles, philosophies

Simplicity: Easy doesn’t mean quick, and hard doesn’t mean many lines of code.

Maintainability: Every added change increases error risk. (An acronym to remember is: You ain’t gonna need it=YAGNI. Avoid project scope creep. It may be possible to prepare for a future solution without increasing scope today.)

Reliability: Cost of fixing a problem in wild (in an implemented application) is much more expensive than during development. Promote intuitive, simple and robust software. You don’t want loss of confidence with those involved. A 2-month delay is less costly than releasing software in a hurry and fixing it later (in development time and reputation).

Change management should record decisions and maintain history, include onboarding and recalling, subsequent changes, breaking of prior fixes, verifying each requirement is met and that everything works cohesively. There’s value to people who don’t start fires.

To loop is human. To recurse* is divine? Simplicity, maintainability, elegance, complexity and balance can help. Sen said that to code is human and to debug is divine, but perhaps never having to debug is divine? (*In software, to recurse is when a function calls itself to solve a complex problem by breaking the problem into pieces.)

Software methodologies such as agile, waterfall and pair programming can help. Sen has had success working in a hybrid test-driven development, that is, 1) Write requirement tests first, and 2) Write code only enough to get the test to pass. It is an interesting concept and decreases firefighting.

Deployment and support include developing test systems and a test framework, working on the art of debugging and utilities. Regression testing is planned before the next release, connecting to hardware with a battery of tests. A source debugger is available and can provide better support if used with other tools.

Workflow: Ensure workflow is documented, understood and followed. An example workflow chart is shown in Figure 3.

Figure 3: Software programming, coding and development benefit from a documented workflow, said Devraj Sen, CTO and VTScada by Trihedral developer. Sen is among presenters at the ScadaFest by Trihedral event Courtesy: Mark T. Hoske, Control Engineering

Other development process tips: Designate independent validators, providing multiple sets of eyes. Keep cybersecurity consciousness according to IEC 62443-4-1. Use continuous automated builds. Use your own software (dogfooding) and take advantage of skilled early adopters to provide feedback.

Continuous delivery is used. Engineering projects and services follow the same process. There’s a need for software development talent, not just workers, Sen said. Every 2 weeks we evaluate Microsoft fixes. Average time to detect a bug from creation is 7 years. Always consider the technical debt of writing custom code. (With great power comes great responsibility.) Sometimes it’s necessary to walk away from a problem. Use published application programming interfaces (APIs), templated tag types, widgets and expressions.

[Question from Sen to the audience: Why did the edge server go bankrupt? Answer: Because it ran out of cache.]

Parting programming advice, answers to questions

What are the parting takeaways on industrial software code development? Sen’s advice is to pay particular attention to simplicity, reusability, maintainability, while reducing technical debt and employing change management.

Some audience questions and Sen’s answers follow.

Do you have hiring tips for developers? Look at universities and for those involved in industry, physics, security and game developers. Don’t discriminate or limit adjacent experiences.

Is one person’s fix ever another person’s bug? It can be. Try to avoid bugs and fixes that can result from a feature change. Always try to maintain backward compatibility.

If the easiest answer is to upgrade, will that be the answer? It depends, but if suffering is intense, an upgrade may be the best answer.

We have many servers and are trying to avoid downtime, how do we proceed? Schedule downtime and choose the locations carefully. If multiple versions exist on various servers, the best answer may be to upgrade all of them.

How should feature requests be handled? Consider requests and prioritize, with attention to needs of system integrators, end-users and deployment timelines, among other factors.

Mark T. Hoske is editor-in-chief, Control Engineering, WTWH Media, [email protected].

Keywords

SCADA, software programming, code development tips

Consider this

How can your software programming improve?

You also might like

New SCADA functionality: Improved communications, security, navigation

Videos on new SCADA functionality: executive insights

https://www.controleng.com/videos-on-new-scada-functionality-executive-insights/

Written by

Mark T. Hoske

Mark Hoske has been Control Engineering editor/content manager since 1994 and in a leadership role since 1999, covering all major areas: control systems, networking and information systems, control equipment and energy, and system integration, everything that comprises or facilitates the control loop. He has been writing about technology since 1987, writing professionally since 1982, and has a Bachelor of Science in Journalism degree from UW-Madison.