Part 2: Introduction to Tags and Folders

Help Contents

Introduction

In Fernhill SCADA Tags represent the resources in the SCADA system. For example:

You use the Tag Window of the Configuration Tool to edit tags:

The tag window of the configuration tool

Tags are organized using folders, which is similar to the way files are organized in a file system. You can use folders to group together logically related tags. For example:

Aims of this Section

In this part of the Getting Started Guide you will use the Configuration Tool to:

  1. Create new tags.
  2. Edit tag properties.
  3. Monitor the status of tags.

You will create tags to monitor these signals from a pump:

SignalTypeDescription
PumpState Digital Whether the pump is running (TRUE) or stopped (FALSE).
Current Analog The current consumption of the pump in Amps.

Tags and Folders

  1. In the Tag Window, right-click the database root folder Database root icon localhost. Then select Add New Folder:

    The Fernhill SCADA Tag Window showing a newly created folder.

    When you create a new folder or new tag, a new name is automatically generated. For information on how to rename tags, and which characters are valid in tag names see Tag Window Tag Names.

  2. Enter the name Getting Started then press Return:

    The Fernhill SCADA Tag Window showing a renamed folder.

  3. Right-click the new folder Getting Started the select Add new tag, followed by Core and then IEC 61131-3 Program. Press Return to accept the default name for the program:

    The Fernhill SCADA Tag Window after adding a logic program.

    This example will use an IEC 61131-3 Program Tag to simulate the pump operation.

  4. Double-click the IEC 61131-3 Program Tag to open the text editor:

    An IEC 61131-3 Structured Text program in the text editor.

    When you create a new IEC 61131-3 Program, a default template is provided. Press CTRL-A to select all text in the program. Then press DEL to delete the default template. In the next step you will add the code to generate test data.

  5. Copy and paste the following code into the text editor:
    Var_Global
        (* These global variables will be the data source for the data point tags *)
        PumpRunning : BOOL;
        MotorCurrent : LREAL;
    End_Var
    
    Program Main
        VAR 
            Timer : TON; 
            RandomValue : WORD;
        End_Var
    
        (* Use a TON function block to trigger every 5 seconds... *)
        Timer( IN:=NOT Timer.Q, PT:=t#5s );
    
        (* If the timer has elapsed... *)
        If Timer.Q Then
        
            (* Get a random value *)
            RandomValue := SysGetRandomWord();
    
            (* Work out the new pump state *)
            If RandomValue < 16#8000 Then
            
                (* Pump stopped *)
                PumpRunning := FALSE;
                MotorCurrent := 0.0;
            
            Else
    
                (* Pump running *)
                PumpRunning := TRUE;
                MotorCurrent := 15.0 + TO_LREAL(RandomValue AND 16#FFF) / 4096.0;
            
            End_If
        End_If
    End_Program
    

    This code should replace the default template provided when you created the IEC 61131-3 Program Tag.

  6. Click the Save icon in the toolbar. Check there are no errors reported in the Status Views Window:

    Configuration Tool Tag Status Window showing the status of the program

    If there are errors shown, go back to step 5 and check the code was pasted correctly.

    Close the program code window.

  7. In the Tag Window, right-click the Getting Started folder and select Add new tag, followed by Core, then I/O Digital Tag. Set the name of the tag to Pump State:

    Tag Window after adding the pump state tag.

  8. In the Properties Window, click the Browse button Browse Button of the IODataSource property. A dialog opens allowing you to choose the tag that will provide the data to the I/O Digital Data Point Tag:

    The browse data source dialog.

    Note: Make sure the Relative Reference field is checked.

    In this example an IEC 61131-3 Program is the data source. In a real application the data source would be a PLC Device Tag or other type of data source.

  9. Select IEC 61131-3 Program and click OK. In the Properties Window, click the Browse button Browse Button of the IOItemName property. A dialog opens allowing you to choose the program variable to use as the data source for the I/O Digital Data Point Tag:

    The browse item name dialog.

  10. Select PumpRunning and click OK. Enter these additional values in the Properties Window:

    PropertyValue
    TextState0Stopped
    TextState1Running

    The values in the Properties Window should now look like this:

    The completed properties of the PumpRunning signal.

    The IODataSource property is reference property and allows one tag to refer to another tag. In Fernhill SCADA there are two types of reference value:

    Relative references are an important concept in Fernhill SCADA and will be described more in Part 5: Copying and Pasting.

  11. Check the status of the new I/O Digital Data Point Tag in the Status Views Window:

    Configuration Tool Tag Status Window showing the status of the digital tag

  12. In the Tag Window, right-click the Getting Started folder and select Add new tag, followed by Core, then I/O Analog Tag. Set the name of the tag to Motor Current:

    Tag Window after adding the motor current tag.

  13. In the Properties Window, set these properties of the Motor Current tag:

    PropertyValue
    IODataSource.IEC 61131-3 Program
    IOItemNameMotorCurrent
    IOItemType32-bit floating point
    UnitsAmps

    When complete, the properties should look like:

    Motor Current tag properties.

  14. Check the status of the new I/O Analog Data Point Tag in the Status Views Window:

    Configuration Tool Tag Status Window showing the status of the analog tag

Next Steps

Continue with Part 3: Introduction to Graphic Pages.

Further information

Configuration Tool Reference

To learn about the Configuration Tool.

Properties Window

To learn about the editing tools in the Properties Window.

Glossary

For the meaning of terms used in Fernhill SCADA.