pvRemoveAllUserColumns()

Deletes all columns that were added via pvAddColumn().

Synopsis

int pvRemoveAllUserColumns();

Parameters

-

Return value

The function returns 0 when it was successfully executed and -1 in case of errors.

Error

Missing or wrong arguments

Description

Deletes all columns that were added via pvAddColumn().

EXAMPLE

The following example shows how to add columns to the project view. The script contains a dpConnect() call. Via the call columns are added to the project view of GEDI. Proceed as follows:

  • To execute the script, create a dyn_string data point as shown in the figure below.

  • Save the following script as the projectView.ctl under WinCC_OA_Proj/scripts/gedi/projectView.ctl. and restart GEDI. You can also copy the script "projectView.ctl." from the WinCC OA version directory and replace the code by the following code.

  • Add column names to the data point via PARA as shown in the figure below.

  • Columns are first deleted viapvRemoveAllUserColumns() if user-defined columns exist.Then the columns are added to GEDI.

  1. #uses "CtrlPv2Admin"
    
    
    //--------------------------------------------------------------------------------
    
    
    main()
    
    
    {
    
    
      if ( !isEvConnOpen() )
    
    
      return;
    
    
      dpConnect("callback", true, "dpDynString.");
    
    
    }
    
    
    
    callback(string dp, dyn_string values)
    
    
    {
    
    
      pvRemoveAllUserColumns();
    
    
      for( int i = 1; i <= dynlen(values); i++)
    
    
      {
    
    
       string rs = "rightMousePressed";
    
    
       mapping m;
    
    
       m["icon"] = "StandardIcons/apply_20.png";
    
    
       m["visualIndex"] = i;
    
    
       m["rightMousePressed"] = rs;
    
    
       pvAddColumn(values[i], m);
    
    
       }
    
    
    }
    
    
    rightMousePressed(string fileName,int column) //file = file that is clicked, column = column that is clicked
    
    
    {
    
    
      DebugN("File " + fileName, "clicked");
    
    
    }

Figure: How to add columns to the project view

Availability

UI