Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 9975815, Entry date: 01/29/2002

Deleting data records in user archives using Script function

  • Entry
  • Associated product(s)

How can you delete one or more data records of a user archive using Script?

You can use the "uaArchiveDelete" Script function to delete data records,
whose application is described in the following example.

Preparatory steps:

- Create a user archive entitled "TestArchive" and its associated fields (see Fig. 1)


 Figure 1: Creating the Test Archive

-  In the WinCC Graphics Designer insert a user archive control (Object Pallet > Smart Objects > Control > WinCC User Archive Table Element) and open the dialog for the Properties of the inserted control by double-clicking the control. Now link the control to your test archive  (General tab > Source > Select) 

WinCC_2_e.gif ( 30 KB )  

    Fig. 2: Parameterizing the user archive control in the Graphics Designer

- In order to be able to test the various application cases, created in addition the "DELETE" button and store the following script in the button properties (Button > Mouse > Mouse Click) :  

ua_delete_script_e.pdf ( 2 KB )  

- Start WinCC-RT and fill the user archive created with the following values, for example:

WinCC_3_e.gif ( 7 KB )  

Fig. 3: User archive in WinCC-RT

Options for deleting data records:

a) Deleting INDIVIDUAL data records (here data record 1): 

     uaArchiveDelete( hArchive, "field1 = 11" ) 

b) Deleting ALL data records

    uaArchiveDelete( hArchive, "" ) 

c) Deleting a SPECIFIC data record range  (here data records 3+4)

    uaArchiveDelete( hArchive, "field1>20 AND field1< 40" ) 

Data record, Remove

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit