Filter for DPT, DP and configs
Data point types
The command line option-filterDpType typenamerestricts output to one or more data point types. This option can be used more than once.
Data points
The command line option -filterDp dpname restricts output to the specified data points. Dpname is in the dpNames format, that is, you can also use wildcards (see Control function dpNames()). This option can also be used more than once.
If you specify the structure of a DP and you want to make an ASCII out of all elements belonging to this structure, you must indicate this with ";" after the structure in the option -filterDp. For example, the following command returns all original values of the elements belonging to the structure ExampleDP_BarTrend:
WCCOAascii -filterDp ExampleDP_BarTrend; -filter O -out test.dpl
PowerConfigs
The command line option -PowerConfig restricts output to the specified data points with configured PowerConfigs and is an essential feature while using mass configuration (see also PowerConfigs, basics). The import is made with the format V 3 (for more information on V 3, see the chapter Templates/DP lists, basics). Using this format, you can delete DPs whereby the appended PowerConfigs are also deleted.
When exporting a complete data point type (including master data point, data points and configs), the specific internal data point of type _DynamicDatapoints is exported when using mass configuration and defined PowerConfigs. For example, when exporting the data point type Valve, the internal data point _dt_Valve with the original values has to be taken into account). This applies when exporting with other formats than V 3 or V 4. If the data point type with the PowerConfigs is deleted in the PARA and newly created via importing the exported file, this can cause problems with the PowerConfig configuration of data points. The problem occurs when the internal data point that manages the PowerConfig settings is not taken into account.
If you want to filter out just one data point, specify this filter: -filterDp data point name* .
Option -filterFile
If the number of data point types and data points to filter is high, you can use the option -filterFile filename. The file filename is read line by line and parsed as follows:
-
Ignores leading spaces and tabs. Ignores empty lines and lines beginning with #.
- The keyword DPTYPE: means data point types to track.
- The keyword DP: means data points to track.
Both keywords DPTYPE: and DP: can occur more than once in the file.
Example
Content of ASCII file filtername:
# Filter file for Test 1
DPTYPE: Type1
Type2
Type3
DP:
Motor01*;
Insert a blank line at the end of the filter file in order to have the correct functionality when filtering data.
Command line:
WCCOAascii -proj [projectname] -out [filename including path] -filterFile [filter file name including
path]
e.g.
WCCOAascii -proj WinCCOA_Proj -out D:\DPs\DPTest -filterFile
D:\WinCC_OA_Projects\WinCCOA_Proj\dplist\dpfilter.dpl
After output, the ASCII file test1 contains the data point types Type1, Type2 andType3 and all data points starting with Motor01.
Configs
The option -filter P can be changed to specify which configs to output. The configs can be specified using their neutral or their German name.
-filter P:_address,_smooth,_alert_class,_alert_hdl
DPCommentSeparator
The format and unit are stored together with the data point comment (multi-lingual text). A separator is required to separate them. Therefore, make sure that there are no characters in the multi-lingual texts of the data point elements that correspond to the separator (default "@"). If this is the case, either change the DpCommentSeparator in the config file or replace the character in the multi-lingual text.
The ASCII Manager must input the multi-lingual text, format and unit together with the above separator (as CommentName). If, for example, only the multi-lingual text is input, the format and unit are lost.
Example
This is a text@%6.2f@Liter
This returns "This is a text" in dpGetDescription(), "%6.2f" in dpGetFormat() and "Liter" in dpGetUnit().
It was necessary to split up the multi-lingual text for the following CTRL functions: dpGetFormat(), dpSetFormat(), dpGetUnit(), dpSetUnit() and dpValToString().
The CTRL functions dpGetDescription() and dpSetDescription() were adapted so that any existing formats and units in the text are not output or changed.