SCADA Tutorial #9 | Scripts (Part 1/2) | C# & VB, Error Handling, Sync vs Async Execution

📌 In this episode of the Wise SCADA training series, we take an in-depth look at how C# and Visual Basic–based scripts are created, managed, and safely executed within SCADA projects.

In this lesson, we cover the core structure of scripts, tag access methods, logical operations, and most importantly, the differences between synchronous and asynchronous execution, explained through real-world industrial scenarios.

You will learn how to prevent system crashes caused by faulty scripts, how to properly implement Try–Catch blocks, and why monitoring errors via String Tags instead of Message Boxes is considered a best practice in professional SCADA applications.

We also demonstrate how scripts can be triggered using buttons, alarms, and event-based mechanisms in Runtime and Setup modes, enabling you to build more flexible, reliable, and scalable Wise SCADA projects.

🔊 Multi-Language Audio Available! This Wise SCADA training video includes multiple audio tracks. Click the Settings (⚙️) icon and select “Audio Track” to choose your preferred language.

📌 What You Will Learn in This Lesson

✅ Script Creation – Creating new script files and understanding the Public Void Main structure

✅ Tag Definition – Using public tags and productivity shortcuts

✅ Logical Operations – Reading, setting, and incrementing tag values

✅ Error Handling – Preventing crash scenarios using Try–Catch blocks

✅ Error Monitoring – Writing error messages to String Tags

✅ Synchronous vs Asynchronous Execution – When and why to use asynchronous mode

✅ Performance Considerations – Understanding system impact and optimization

✅ Tag Access Methods – Direct access vs. Tag.Set() (asynchronous) usage

✅ Script Triggering – Running scripts via buttons, alarms, Runtime, and Setup events

  • 00:00 – Introduction and Creating a New Script
  • 00:14 – Public Tag Definition and Shortcuts
  • 00:39 – Logical Operators and Value Assignment
  • 01:09 – Triggering Scripts via Screen Buttons
  • 01:53 – Script Errors and Crash Scenarios
  • 03:11 – Error Handling with Try–Catch Blocks
  • 04:09 – Writing Errors to String Tags (Best Practice)
  • 05:39 – Asynchronous Execution Settings
  • 06:13 – Using Done and Fault Bits
  • 07:51 – Tag Access Methods: Direct Access vs. Tag.Set
  • 09:52 – Key Differences Between the Two Access Methods
  • 11:03 – Script Triggering Methods (Alarm, Setup, Runtime)

Leave a Reply