1、Designation: G 135 95 (Reapproved 2007)Standard Guide forComputerized Exchange of Corrosion Data for Metals1This standard is issued under the fixed designation G 135; the number immediately following the designation indicates the year oforiginal adoption or, in the case of revision, the year of last
2、 revision. A number in parentheses indicates the year of last reapproval. Asuperscript epsilon (e) indicates an editorial change since the last revision or reapproval.1. Scope1.1 This guide covers the techniques used to encode corro-sion of metals test results for exchange between computersystems.1.
3、2 Guidelines are given for creating a data exchangeappendix for each ASTM corrosion of metals standard.1.3 Instructions are given for creating data translation soft-ware from the contents of the data exchange appendix.2. Referenced Documents2.1 ASTM Standards:2G 106 Practice for Verification ofAlgor
4、ithm and Equipmentfor Electrochemical Impedance MeasurementsG 107 Guide for Formats for Collection and Compilation ofCorrosion Data for Metals for Computerized DatabaseInput2.2 ANSI Standards:3ANSI/ISO 9899 1990 1992 Programming Language CANSI X3.4-1986 Coded Character Set 7 Bit ASCII3. Terminology3
5、.1 Definitions:3.1.1 datatypea group of rules specifying the format of anobject.3.1.2 global datainformation shared among several stan-dards.3.1.3 local datainformation specific to a certain standard.3.1.4 semanticsinformation meaning.3.1.5 syntaxinformation format.3.1.6 tagged objecta named block o
6、f information.3.1.7 translatora computer routine which writes or readsdata files.4. Significance and Use4.1 This guide establishes a formalism for transferringcorrosion test data between computer systems in differentlaboratories. It will be used by standards developers to specifythe format of files
7、containing test results.4.2 This guide defines a generic approach to structuring datafiles. It will be used by software developers to create programswhich read and write these files.4.3 Each standard test procedure will define a unique datafile derived from this guide. Each time a standard test ispe
8、rformed, the results can be summarized in a data file specificto that test.4.4 Some experimental information will be global, that is,common to several standards, and will be contained in GuideG 107 and other global data dictionaries. Other informationwill be local, that is, unique to a given standar
9、d, and will bedefined in that standard.5. Guide for Standards Authors5.1 Local and Global Data:5.1.1 Some information may be used across several corro-sion standards, that is, global. Global data is defined in GuideG 107 and other global standards.5.1.2 Some information may be local to a particular
10、corro-sion standard. Local data is defined in the standards dataexchange appendix.5.2 Data File:5.2.1 Each test will generate a single test data file. File nameformats are not specified.5.2.2 The data file is arranged as a set of named or taggedobjects. Each time a standard test is performed a set o
11、f objectsis obtained. The data file can be thought of as a permanentrepository for this set of objects.5.2.3 Each tagged object will take two or more lines in thedata file. Lines are strings of ASCII (ANSI X3.4-1986) char-acters terminated with a carriage return/linefeed character pairor a single li
12、nefeed character.5.2.4 Lines are further subdivided into tab delimited ASCIIfields that are particularly suitable for manipulation by spread-sheet and scientific charting programs. For example, Fig. 1shows how a section of a data file would show up on printedoutput.1This guide is under the jurisdict
13、ion of ASTM Committee G01 on Corrosion ofMetals and is the direct responsibility of Subcommittee G01.05 on LaboratoryCorrosion Tests.Current edition approved May 1, 2007. Published May 2007. Originallyapproved in 1995. Last previous edition approved in 2001 as G 13595(2001).2For referenced ASTM stan
14、dards, visit the ASTM website, www.astm.org, orcontact ASTM Customer Service at serviceastm.org. For Annual Book of ASTMStandards volume information, refer to the standards Document Summary page onthe ASTM website.3Available from American National Standards Institute (ANSI), 25 W. 43rd St.,4th Floor
15、, New York, NY 10036, http:/www.ansi.org.1Copyright ASTM International, 100 Barr Harbor Drive, PO Box C700, West Conshohocken, PA 19428-2959, United States.5.3 Tagged Object:5.3.1 A tagged object is a repository for an individual blockof information. It may be a simple piece of data, the test datefo
16、r example, or it may be complex, such as a current/voltage/time curve. A tagged object contains three subordinate areas:(1) the tag, (2) the datatype, and (3) the actual data. The tag anddatatype are the first two fields of the first line while the actualdata is contained in subsequent lines. Data l
17、ines are alwaysindented one tab space. This is illustrated in Fig. 2.5.3.2 Tag:5.3.2.1 The objects tag is a simple string that uniquelyidentifies it among other objects in a tagged object set.5.3.2.2 When implementing a translator for a given stan-dard, the implementation is free to define other tag
18、ged objectnames so long as they dont clash with those defined in thestandard. It is suggested that additional names be prefixed withsome unlikely and unique combination of alphanumeric char-acters so that name conflicts do not arise in future versions ofthe standard. For example; NewTest_Apex Potent
19、ial.5.3.2.3 Tags are made up of one or more character stringsseparated by periods. The first character in each string must bealphabetic (including the underscore). Subsequent charactersmay be alphanumeric.5.3.2.4 Periods should only be used to associate differentobjects together. For example, Matl.C
20、lass, Matl.SubClass,Matl.TradeName, are all aspects of Material. In future speci-fications it is suggested that this be done using complex,multifield datatypes.5.3.2.5 Periods should not be used to separate multiple wordindividual concepts. Instead use capitalization or underscore.For example; Contr
21、olMode or Control_Mode.5.3.2.6 Tags are case insensitive although mixed case issuggested for readability.5.3.3 Datatype:5.3.3.1 Each object has a datatype which specifies theformat of the objects data.5.3.3.2 Global datatypes are defined in a global data ex-change standard such as Guide G 107 and ar
22、e repeated here forreference, as follows:(a) String (STRING)Strings contain purely characterinformation. Strings may be further encoded depending on thesemantic description of the object.(b) Quantity (QUANT)Quantities represent numeric val-ues along with their units. Units may be further encodeddepe
23、nding on the semantic description of the object.(c) Date (DATE)Dates are simple day specifiers.(d) Time (TIME)Times are simple time of day specifiers.(e) Category Set (SET)Category sets are used to repre-sent choices. The actual meaning of each value is given in thesemantic description of the object
24、.(f) Tabular (TABLE)Tables are used to hold arrays ofrecords. The datatype, units, and name of each column is alsoencoded.5.3.3.3 Aparticular implementation of a test is free to definelocal datatypes as long as they dont clash with those definedin global standards. These local datatypes are defined
25、in thestandards data exchange appendix.5.3.3.4 The datatype has a unique identifier made up of astandard number and a name separated by a period; forexample, G107.SET. Each time an object is recorded in thedata file, the datatype identifier is recorded with the object.That identifier specifies to th
26、e translator (either computer orhuman) what data format to use in reading the data from orwriting the data to the file.5.3.3.5 In cases where the reading translator is unable tofind a datatype in its internal table, that object will be markedas untranslated. The translator is free to take the approp
27、riateaction depending on the importance of the object.5.3.3.6 It is important to note that the datatype doesntcompletely specify the meaning of the data, only its format. Forexample, a value of one for the tag “Surface.Condition” has avery different meaning than the value of one for the tag“Potentio
28、stat.ControlMode” even though they are both of typeG107.SET. Those meanings are construed from the tag.5.3.4 Data:5.3.4.1 The objects data is arranged in a format defined bythe datatype. Data starts in the second line of the data object.There may be multiple lines and multiple fields associated with
29、a data object. Each data line is indented by one tab space todistinguish it from the tag/datatype lines.5.4 Data Exchange Appendix:5.4.1 Standard tests that use this guide will contain a dataexchange appendix. This appendix contains the data andFIG. 1 Data File SampleFIG. 2 The Elements of a Tagged
30、ObjectG 135 95 (2007)2format information required to define test data files. For anexample see Appendix X1.5.4.1.1 The data exchange appendix should have three parts,the local datatype definitions section, the object definitiontable, and a sample data file.5.4.2 The local datatype definitions sectio
31、n gives a descrip-tion of and formal syntax for each local datatype. This gives therules of translation to programmers who are creating translatorsfor the standard.5.4.2.1 The rules should be written using the formal lan-guage described in Section 7. The translation rules for severaldata types are g
32、iven in Section 6. The QUANT type isreproduced in Fig. 3 as an example:5.4.3 The object definition table is a tabular listing of all theobjects in the file. For example, consider Table 1. There arefour objects in this table: Standard, Date, ControlMode, andSpectrum. In an actual standard there may b
33、e many more.5.4.3.1 Each row of the table defines a data object. Theseobjects may be copied from global standards such as GuideG 107 or may be locally defined. An object definition shouldnot refer to another standard test since a revision of that testmay change the object definition without warning.
34、5.4.3.2 Column Definitions (as illustrated in Table 1):NOTE 1Columns 1, 2, and 3 are required for global objects. Columns1 to 6 are required for local objects.(a) Reference Number (Column 1)The reference number is a uniquenumber referring back to the standard and paragraph where the data objectis de
35、fined. This number is made up of a Standard ID and a paragraphnumber separated by a period(.).(b) Tag/Column Tag (Column 2)This column contains the data tag. Ifthe data object is tabular, this column will also contain sub-tags orheadings for each column of the object.(c) Required (Column 3)This colu
36、mn indicates whether a particularobject is required or can be safely omitted from the data file.(d) Description (Column 4)The description column contains freeform text describing the object. Constraints, defaults, or other specifica-tions may show up here.(e) Datatype (Column 5)The type gives the da
37、tatype of the object.The data types may be global types defined in Guide G 107, or they maybe local to the standard being written.(f) Category Set/Units/Column Information (Column 6)This columnvaries depending on the datatype. If the type is a SET, Column 6 containsthe allowed values and meanings. I
38、f the type is a QUANT, Column 6contains suggested units. If the type is a TABLE, Column 6 contains unitsor allowed values as required by the datatype of each column.5.4.4 The last required section of the data exchange appen-dix is a sample data file. This should show a file as actuallyprinted althou
39、gh data may be omitted for the sake of space.6. Guide for File Translator Programmers6.1 The following section is intended for programmers whoare writing data exchange translators. A translator is a portionof a program which reads or writes a data file. Production rulesare shown in bold-face Courier
40、 font.6.1.1 Character SetThe data is stored in anASCII text filewhich can be directly printed using most printers and manipu-lated using most text editors (see Fig. 4).6.1.2 FileThe data file is arranged as a sequence of taggedobjects.File : = TaggedObject 1 . .*6.1.3 Tagged ObjectAtagged object sta
41、rts with its tag lineand includes all the information up to the next tag. Any otherlines associated with the object must be indented one tabcharacter. Each line is terminated with a line feed or carriagereturn/line feed pair.TaggedObject : = TagLine DataBlock6.1.3.1 Tag LineThe first line of a tagge
42、d object is calledthe Tag Line. It contains the tag or name of the object and theformat specifier.TagLine : = TagField FormatField CommentField NewLine6.1.3.2 TagA tag must start with an alphabetic characteror underscore ( _ ). Thereafter numeric characters can beused as well as alphabetic and under
43、score. Tags may notcontain spaces. The only other punctuation allowed is a period(.) character. Any character following a period must bealphabetic or underscore. Tags are not case sensitive.TagField : = Tag TabTag : = Identifier (Period Identifier) 0 . .*Identifier : = AlphabeticChar AlphanumericCha
44、r 0 . .*6.1.3.3 FormatThe second field in the Tag Line is aformat specifier, either by paragraph reference; for example,Guide G 107.7.1.4.1, or by shorthand name; for example,STRING. The format specifier specifies how the rest of thetagged object is to be translated.FormatField : = Organization Peri
45、od Standard Period Identifier TabFIG. 3 Translation Rules for the Quant Data ObjectG 135 95 (2007)36.1.3.4 Data LinesAny lines following the tag line up tothe next tag line are data lines associated with the taggedobject.As previously stated, data lines must begin with a tab sothat they may be disti
46、nguished from tag lines. The data linesare subdivided into tab delimited fields, that is, each data fieldis followed by a tab.DataBlock : = DataLine 0 . .*DataLine : = Tab DataField 0 . .* CommentField NewLine6.1.3.5 Data FieldsData fields may not start with semi-colons. Data fields must contain onl
47、y printable characters. Datafields must not contain any internal tab characters since a tabindicates the end of the field. The format and meaning ofcharacters in a data field are defined in the object format.DataField : = PrintableCharExceptSemicolon PrintableChar 0 . .*Tab6.1.4 Comments:6.1.4.1 Com
48、ment lines may be interspersed in among datalines. Comment lines must start with a tab and then asemicolon (;). The line is not translated or counted in any way.TABLE 1 Object DefinitionsReference Number/Column NumberTag/Column Tag Required Description/Column Description Type/Column TypeCategory Set
49、/Suggested Units/Column InformationG 107.5.1.4.1 Standard Yes Standard test specification STRINGG 107.5.1.4.3 Date Yes date test started DATEG 106.X2.1 ControlMode Yes Circuit configuration SET Allowed Values1. Potentiostat2. Galvanostat3. ZRA4. V applied/No feedback5. I applied/No feedback6. OtherG 106.X2.2 Spectrum Yes Corrected frequency spectrum TABLEColumn 1 Frequency Frequency QUANT HzColumn 2 Signal Applied Signal QUANT V, AColumn 3 ZReal Z real QUANT ohmColumn 4 ZImag Z imaginary QUANT ohmColumn 5 StdDev Standard Dev