1、Designation: G135 95 (Reapproved 2013)Standard Guide forComputerized Exchange of Corrosion Data for Metals1This standard is issued under the fixed designation G135; the number immediately following the designation indicates the year oforiginal adoption or, in the case of revision, the year of last r
2、evision. A number in parentheses indicates the year of last reapproval. Asuperscript epsilon () 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.2 G
3、uidelines 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:2G106 Practice for Verification of Algorith
4、m and Equipmentfor Electrochemical Impedance MeasurementsG107 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.1 D
5、efinitions: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 of in
6、formation.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 cont
7、aining 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 isperfor
8、med, 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 GuideG107 and other global data dictionaries. Other information willbe local, that is, unique to a given standard, an
9、d will be definedin 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 GuideG107 and other global standards.5.1.2 Some information may be local to a particular corro-
10、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 of obje
11、ctsis 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)characters terminated with a carriage return/linefeed characterpair or a single linefeed c
12、haracter.1This guide is under the jurisdiction of ASTM Committee G01 on Corrosion ofMetals and is the direct responsibility of Subcommittee G01.05 on LaboratoryCorrosion Tests.Current edition approved May 1, 2013. Published July 2013. Originally approvedin 1995. Last previous edition approved in 200
13、7 as G13595(2007). DOI:10.1520/G0135-95R13.2For referenced ASTM standards, 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 Am
14、erican National Standards Institute (ANSI), 25 W. 43rd St.,4th Floor, New York, NY 10036, http:/www.ansi.org.Copyright ASTM International, 100 Barr Harbor Drive, PO Box C700, West Conshohocken, PA 19428-2959. United States15.2.4 Lines are further subdivided into tab delimited ASCIIfields that are pa
15、rticularly 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.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,
16、 the test datefor 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 tagand datatype are the first two fields of the first line while theactual data is contained in subsequ
17、ent lines. Data lines arealways indented 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 givenstandard, the implementation is free to d
18、efine other taggedobject names so long as they dont clash with those defined inthe standard. It is suggested that additional names be prefixedwith some unlikely and unique combination of alphanumericcharacters so that name conflicts do not arise in future versionsof the standard. For example; NewTes
19、t_Apex Potential.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 ex
20、ample, Matl.Class, 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 e
21、xample; ControlMode 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
22、 G107 and are repeated here forreference, as follows:(a) String (STRING)Strings contain purely character in-formation. 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 furth
23、er encodeddepending 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
24、 of the object.(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 datatype
25、s are defined 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 s
26、pecifies to the 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 t
27、ake the appropriateaction 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 th
28、e tag“Potentiostat.ControlMode” even though they are both of typeG107.SET. Those meanings are construed from the tag.5.3.4 Data:FIG. 1 Data File SampleFIG. 2 The Elements of a Tagged ObjectG135 95 (2013)25.3.4.1 The objects data is arranged in a format defined bythe datatype. Data starts in the seco
29、nd line of the data object.There may be multiple lines and multiple fields associated witha 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.
30、This appendix contains the data andformat 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 defin
31、itions section 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 severaldat
32、a types are given 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 standar
33、d there may be many more.5.4.3.1 Each row of the table defines a data object. Theseobjects may be copied from global standards such as GuideG107 or may be locally defined. An object definition shouldnot refer to another standard test since a revision of that testmay change the object definition with
34、out warning.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
35、 objectis defined. 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
36、 3)This column 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
37、gives the datatype of the object.The data types may be global types defined in Guide G107, 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
38、meanings. If 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 actuallypri
39、nted although 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-f
40、ace Courier 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
41、 object starts 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
42、 of a tagged 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 TagAtag must start with an alphabetic character orunderscore ( _ ). Thereafter numeric characters can be usedas well as alphabetic
43、 and underscore. Tags may not containspaces. The only other punctuation allowed is a period (.)character. Any character following a period must be alphabeticor underscore. Tags are not case sensitive.FIG. 3 Translation Rules for the Quant Data ObjectG135 95 (2013)3TagField : = Tag TabTag : = Identif
44、ier (Period Identifier) 0 . .*Identifier : = AlphabeticChar AlphanumericChar 0 . .*6.1.3.3 FormatThe second field in the Tag Line is aformat specifier, either by paragraph reference; for example,Guide G107.7.1.4.1, or by shorthand name; for example,STRING. The format specifier specifies how the rest
45、 of thetagged object is to be translated.FormatField : = Organization Period Standard Period Identifier Tab6.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
46、be distinguished from tag lines. The data linesare subdivided into tab delimited fields, that is, each data fieldis followed by a tab.TABLE 1 Object DefinitionsReference Number/Column NumberTag/Column Tag Required Description/Column Description Type/Column TypeCategory Set/Suggested Units/Column Inf
47、ormationG107.5.1.4.1 Standard Yes Standard test specification STRINGG107.5.1.4.3 Date Yes date test started DATEG106.X2.1 ControlMode Yes Circuit configuration SET Allowed Values1. Potentiostat2. Galvanostat3. ZRA4. V applied/No feedback5. I applied/No feedback6. OtherG106.X2.2 Spectrum Yes Correcte
48、d 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 Deviation QUANT noneFIG. 4 Definition of the Character SetG135 95 (2013)4DataBlock : = DataLine 0 . .*Da
49、taLine : = Tab DataField 0 . .* CommentField NewLine6.1.3.5 Data FieldsData fields may not start with semico-lons. Data fields must contain only 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 Comment lines may be interspersed in among datalines. Comment lines must start with a t