FieldClassify (Specify Measurement Classification of a Field)
Use FieldClassify() to attach a user-defined classification code to a data field in the table definition metadata. This provides cloud applications with additional information that can be used to interpret and offer more details about field values. When a cloud environment receives this classification code, it is the responsibility of the application to interpret the value and determine what action to take.
FieldClassify( Class_List )
In the single-field example, the code assigned to air_temperature_C appears in the field’s class entry in the metadata JSON output.
In the metadata JSON output, FieldClassify("&H01000104") appears as the decimal value 16777476.
Single Field Example:
DataTable (Air_Temperature,1,-1)
DataInterval (0,5,Sec,10)
Sample (1,air_temperature_C,IEEE4)
FieldClassify("&H01000105")
EndTable
Multi-Field example:
DataTable (HygroVUE10,1,-1)
DataInterval (0,5,Sec,10)
Sample (4,HygroVUE10,IEEE4)
FieldClassify ("&H01010101,&H02010101,&H01010101,&H02010101")
EndTable
Example Output:
Subscribe cs/v2/metadata/ABCD-EFGH-1234/metadata/Air_Temperature
{
"fields": {
"key": [
"type",
"settable",
"size",
"class",
"stream"
],
"definitions": {
"air_temperature_C": [
"xsd:float",
false,
1,
16777476,
-1
]
}
}
}
Remarks
The FieldClassify instruction must be placed within the DataTable declaration, immediately following the output instruction for the fields being classified.
Use one FieldClassify() per table output processing instruction (e.g., Sample , Average , Totalize ).
CampbellCloud uses hexadecimal classification codes, but that is only one implementation method. Other cloud platforms may choose different formats and define their own schema. An example classification reference is available at campbell-m2i.xyz/classifications.
Below is an example of how a classification list or single code is used to define metadata in CampbellCloud:
Parameters
Class_List
A string that can contain any code, tag, or text schema you want your cloud application to interpret. When repetitions (reps) are used, FieldClassify() takes a single string containing a comma-separated list of values, one for each field.
Type: String or variable