SimpleVG › Tutorial › Chapter 10

Chapter 10: SCADA Tagging

Goal Give a shape an ID, a class and a tag name on the SCADA Tagging tab, and see where those end up in the SVG, so that a system which reads them can find and animate it.

A drawing on its own is just a picture. To make it part of a live screen, some systems need to be able to say “this shape is valve FV101” and change how it looks when the valve opens. In SVG that is done with attributes on the shapes, and the SCADA Tagging tab is where you set them.

Before you start SentinelSCADA does not use these tags for its own functionality. They are there so you can add tag information to your artwork for other systems that do read it. If you only plan to use your drawings in SentinelSCADA, you can safely skip this chapter.

Part 1: The SCADA Tagging tab

Drop a Valve Body onto the canvas, as in Chapter 4, then click the SCADA Tagging tab in the Inspector.

The SCADA Tagging tab with a valve selected, showing empty Element ID, CSS Class and Custom Data Attribute fields

The tab has three fields and a row of quick tags:

Element ID (id)
A unique name for this shape, such as valve_01.
CSS Class (class)
One or more class names. A host system, or a stylesheet, can use them to change how the shape looks, for example to show a running or alarm state.
Custom Data Attribute (data-tag)
The name of the PLC or SCADA tag this shape represents, such as FV101_OPEN.

Part 2: Tag the valve

Type valve_01 into Element ID and FV101_OPEN into Custom Data Attribute. Then click the scada-valve-open chip under QUICK SCADA CLASS TAGS to add that class. The chips add a class without typing, and the other ones are scada-status-running, scada-status-alarm, scada-status-warning and scada-animated-flow.

The SCADA Tagging tab with valve_01 as the ID, scada-symbol-valve scada-valve-open as the class and FV101_OPEN as the data tag

Notice that the class field now reads scada-symbol-valve scada-valve-open. The symbol already carried its own class, and the chip added to it.

Part 3: See it in the SVG

Open the live code drawer from Chapter 5 and click Find Selected. The valve’s group is highlighted, and the three attributes are right there.

The Live SVG code drawer open, showing the valve group with class, id and data-tag attributes

That is the whole mechanism. The SVG you save carries these names, so any system that reads them can look up valve_01 or FV101_OPEN and drive the shape from live data. SimpleVG keeps the tags when you save, and when you open the file again later.

Note Tagging is optional. A drawing with no tags is still a perfectly good SVG. Add tags only to the shapes that need to change.

Recap

In the final chapter we look at the live SVG code drawer in more depth: reading the code, editing it, and using it to find and tidy up shapes.

← Chapter 9: Tracing an Image Chapter 11: The Live SVG Code Drawer →