Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

Use the Tabs Genie

  • Last UpdatedJul 18, 2023
  • 2 minute read

There are two ways to populate data to the tabs:

  1. Set cell value directly to the table.

  2. Binding a Cicode function to return the value for the individual tabs.

Example 1

Set create tabs statically on initialization

The Cicode sample below will be used in the following example. Open the Cicode Editor and create a new Cicode file, for example: _MyTab_Ex1.ci

//Callback function to respond to the initialization event of the tab genie

INT FUNCTION MyTabs_Init(STRING sTabs)

// Pre-populate with 2 auto-width tabs

LibTabs_AddTab(sTabs, "Tab1", 0);

LibTabs_AddTab(sTabs, "Tab2", 0);

RETURN TRUE;

END

  1. From Graphics Builder create a new page (for example, a Normal Tab Style Page).

  2. When created, from the Object Toolbox select the Paste Genie icon.

  3. In the Paste Genie window, select the lib_contols library.

  4. Select the Tabs genie. The genie is pasted onto the graphics page.

  5. In the Tab Genie dialog, configure the fields according to the table below. Click OK to save the changes.

  6. Save the graphics page, and compile and run the project.

    Parameter

    Description

    Tab BarName

    MyTabs1

    Width

    400

    Height

    30

    Initialize

    MyTabs_Init("#Name")

    At runtime the tab layout should look like the following:

    Example 2

    Binding a Cicode function to return the value for the individual tabs

    This is similar to setting a formula in Excel. With binding, cell values are not stored in the tabs control. the control will call the provided Cicode function when it needs the data.

    Using the Cicode sample below, open the Cicode Editor and create a new Cicode file. For example: 'MyTabs_Ex2.ci'

    INT FUNCTION MyTabs_InitDyn(STRING sTabs)

    // Bind callback function for data display

    LibTabs_SetDataTask(sTabs, "Value", "MyTabs_GetCellValue", "^"#Name^",#Tab");


    // Set the number of tabs for the control

    LibTabs_SetCount(sTabs, 3);


    RETURN TRUE;

    END


    //Function to return the value for a data cell

    STRING FUNCTION MyTabs_GetCellValue(STRING sTabs, INT nTab)

    RETURN "Dyn. value for Tab(" + nTab:# + ")";

    END

    1. As in example 1, add a tabs library control to the graphics page.

    2. In the Tabs Genie dialog, configure the fields according to the table below.

    3. Save the graphics page, and compile and run the project.

      Parameter

      Description

      Tabs Name

      MyTabs2

      Width

      400

      Height

      30

      Can Remove Tab

      TRUE

      Initialize

      MyTabs_Initdyn("#Name")

      At runtime the tab layout should look like the following:

      See Also

      Use the Library Controls

      In This Topic
      TitleResults for “How to create a CRG?”Also Available in