WinCC Unified - Clamping tag value

In my previous post, I shared the importance of setting tag limits to prevent bad data from causing issues in SCADA systems. Now, let's talk about another essential safeguard — clamping values.

Clamping vs. Tag Limits

While both clamping and tag limits help control data quality, they serve different purposes:

  • Tag limits: Used to filter out and reject values that exceed a predefined range, preventing them from being processed at all.

  • Clamping: Adjusts out-of-range values to stay within acceptable limits, ensuring the system continues to function without interruption.

Steps to implement Clamping in WinCC Unified

  1. Create Data, Lower and Upper Bound Tags
    • Open the Tag Table and create a data tag (e.g., Data_Integer_Value), a lower bound tag and an upper bound tag
    • Set the lower and upper bound tags with their respective Start value (e.g. upper bound = 100, lower bound = 0) Wincc Unified 3

  2. Link Data Tag to a Screen Element
    • Add a new Screen.
    • In the new screen, add an IO Field element.
    • Link the Process Value of the IO Field to the tag Data_Integer_Value. Wincc Unified 2

  3. Define Upper and Lower Clamping Function
    • Add a Input finished event with the code below.
export function IO_field_1_OnInputFinished(item, value) {

let tag = Tags("Data_Integer_Value");
let lower = Tags("lower_bound").Read();
let upper = Tags("upper_bound").Read();
let result;

if(value < lower){
  result = lower;
}
else if (value > upper){
  result = upper;
}
else{
  result = value;
}

tag.Write(result);
return result;

}

Wincc Unified 1

5. Run Simulation Mode to verify the range settings - Start Simulation Mode. - Try entering values beyond the defined limits to see how the system handles them.

WinCC Unified Simulation

WinCC Unified - Setting tag value limit

Since WinCC Unified V17, users have been able to set upper and lower limits for tags to ensure the value stays within a defined range. This feature is essential for preventing invalid inputs and protects connected devices from unexpected inputs.

In this guide, I’ll walk you through the steps to set tag limits in WinCC Unified V20 using a simple example.

Steps to Define Tag Input Limits

  1. Create a New Tag
    • Open the Tag Table and create a new tag (e.g., Data_Integer_Value)

  2. Access Tag Properties
    • Hover over Data_Integer_Value, then right-click → Properties.

  3. Define Upper and Lower Boundaries
    • Navigate to the Range section.
    • Under Lower2 and Upper2, set the minimum and maximum values according to your requirements. Wincc Unified 1

  4. Link Tag to a Screen Element
    • Add a new Screen.
    • In the new screen, add an IO Field element.
    • Link the Process Value of the IO Field to the tag Data_Integer_Value. Wincc Unified 2

  5. Run Simulation Mode to verify the range settings
    • Start Simulation Mode.
    • Try entering values beyond the defined limits to see how the system handles them. WinCC Unified Simulation

Deploying Nikola site to Cloudflare Pages

This site is built on Nikoka and deployed on Cloudflare Pages . Being a static site generator, you are able to deploy your Nikola site to Pages by following the Static HTML Guide .

As an example, here is an example of Cloudflare Pages settings for a Nikola site hosted on a Github repository.

Under the Build settings section, do the following:

Framework preset = None
Build command = exit 0
Build output directory = SITE/output 

NOTE that SITE is the <directory_name> containing all your Nikola site assets.

Leave the rest as default and click Save and Deploy.

Settings to deploy Nikola site to Pages

By default, Pages will automatically trigger a deployment any time you commit and push your code to your Github repository.

Pages deployment.

Enabling Wi-Fi Channel 13 on the RPi in Singapore

If you are attempting to connect your Raspberry Pi to a 2.4 GHz Wi-Fi channel greater than 11 (i.e Channel 12 and Channel 13), there is a chance that the channel is not exposed to you.

WiFi 1

The reason for this is that you might not have configured your RPi's Wi-Fi Country settings. There is nothing to worry about as it's merely a configuration issue and the Wi-Fi channels have been hidden from you. To expose the channels, bring up a terminal and following the images below.

raspi-config

WiFi 2WiFi 3WiFi 4WiFi 5WiFi 6WiFi 7

Happy hacking!

Singapore FM radio with HackRF One

It's been a while since I've posted due to different excuses. But no more, I hope to continue posting articles regularly in the spirit of learning about new technology. Today's tech gadget is the HackRF One by GreatScottGadgets. The HackRF One is a Software Defined Radio (SDR) hardware used to test and develop radio technolgies.

To keep things simple, I followed the online tutorial by Michael Ossmann and ended up with a flowgraph capable of receiving FM radio signals. I proceeded to modify the flowgraph to make the HackRF pickup all FM radio stations in Singapore. From the screenshots below, I'm guessing you can tell which is my favourite radio station.

The HackRF One is a very interesting piece of hardware and the thing I like most about is the online community. I do foresee many more interesting projects to come. One which immediately comes to my mine is to use the HackRF One to learn more about digital broadcasting in Singapore. Happy Hacking!

Frequency plotGNU Radio

How do IR Flame detectors work?

As a gas turbine controls engineer, part of my job involves woing with ancillary systems such as the fire and gas system. In gas turbine packages, fire and gas systems are used detect fires and flameable gases which are hazards to the operating environment. rk If you are curious to know how an IR flame detector detects a fire caused by hydrocarbons, the answer is by monitoring the IR released from CO2 and H2O in their excited states.

For example:

2 C6H14 + 19 O2 + Energy → 12 CO2 * + 14 H2O *

CO2 * → CO2 + hv (2.8 µm – 4.3 µm)

H2O * → H2O + hv (2.9 µm)

Happy hacking!

IR Flame Detector