@@ -16,28 +16,40 @@ jsonApi.define({
1616 attributes : {
1717 id : jsonApi . Joi . string ( ) . default ( jsonApi . Joi . ref ( '_id' ) ) ,
1818 _id : jsonApi . Joi . string ( ) ,
19+ tagname : jsonApi . Joi . string ( ) . trim ( ) . regex ( REGEX_NAME_STRING )
20+ . description ( "The unique tag name." )
21+ . example ( "MY_AWESOME_TAGNAME" ) ,
22+ input : jsonApi . Joi . any ( ) . optional ( )
23+ . description ( "If tag is writeable, the value to write to the tag in engineering units." )
24+ . example ( "24.5" ) ,
1925 memLocation : jsonApi . Joi . string ( ) . required ( )
2026 . description ( "PLC memory location." )
2127 . example ( "N21:0 or 40001 for modbus driver" ) ,
28+ value : jsonApi . Joi . any ( ) . optional ( )
29+ . description ( "The current value of the tag in engineering units." )
30+ . example ( "24.5" ) ,
31+ rawValue : jsonApi . Joi . number ( ) . integer ( ) . optional ( )
32+ . description ( "The current value of the tag in engineering units." )
33+ . example ( "24" ) ,
2234 valueType : jsonApi . Joi . string ( ) . trim ( ) . regex ( REGEX_VALUE_TYPE )
2335 . default ( 'real' )
2436 . description ( 'Can only be bool, real, integer or string.' )
2537 . example ( 'bool' ) ,
26- tagname : jsonApi . Joi . string ( ) . trim ( ) . regex ( REGEX_NAME_STRING )
27- . description ( "The unique tag name." )
28- . example ( "MY_AWESOME_TAGNAME" ) ,
29- desc : jsonApi . Joi . string ( ) . required ( )
30- . description ( "The tag description." )
31- . example ( "Volts from TrendPoint." ) ,
32- units : jsonApi . Joi . string ( ) . required ( )
33- . description ( "The tag units." )
34- . example ( "Volts" ) ,
38+ dataQuality : jsonApi . Joi . string ( ) . optional ( )
39+ . description ( "The data quality of the value of this tag." )
40+ . example ( "Ok" ) ,
3541 isWritable : jsonApi . Joi . boolean ( ) . default ( false )
3642 . description ( "Can you write to this tag." )
3743 . example ( "FALSE" ) ,
44+ lastUpdate : jsonApi . Joi . date ( ) . optional ( )
45+ . description ( "The last time the current value was updated in UNIX time (ms)." )
46+ . example ( "1463776147123" ) ,
3847 isHistorical : jsonApi . Joi . boolean ( ) . default ( true )
3948 . description ( "Should we store historical data for this tag." )
4049 . example ( "TRUE" ) ,
50+ histDeadbandPercent : jsonApi . Joi . number ( ) . default ( .03 )
51+ . description ( "The percent of change of value field required to trigger a history sample where .03 is 3%. 0 means collect everything." )
52+ . example ( ".03" ) ,
4153 rawMin : jsonApi . Joi . number ( ) . default ( 0 )
4254 . description ( "The minimum raw integer value that the PLC will return for this tag." )
4355 . example ( 0 ) ,
@@ -48,6 +60,12 @@ jsonApi.define({
4860 . example ( 0 ) ,
4961 engMax : jsonApi . Joi . number ( ) . min ( jsonApi . Joi . ref ( 'engMin' ) ) . required ( )
5062 . description ( "The maximum eng units value that corresponds to the rawMax value." ) ,
63+ desc : jsonApi . Joi . string ( ) . required ( )
64+ . description ( "The tag description." )
65+ . example ( "Volts from TrendPoint." ) ,
66+ units : jsonApi . Joi . string ( ) . required ( )
67+ . description ( "The tag units." )
68+ . example ( "Volts" ) ,
5169 inputType : jsonApi . Joi . string ( ) . trim ( ) . lowercase ( ) . regex ( REGEX_INPUT_TYPE ) . optional ( )
5270 . description ( "Only valid for writable tags. one_shot = write the value one time. force = " +
5371 "always do a write if the tag.value is not equal to tag.input. momentary = write a 1 and" +
@@ -57,24 +75,9 @@ jsonApi.define({
5775 . description ( "If true, then count the number of times this tag goes non-zero and track the " +
5876 "amount of time the tag stays non zero." )
5977 . example ( "true" ) ,
60- dataQuality : jsonApi . Joi . string ( ) . optional ( )
61- . description ( "The data quality of the value of this tag." )
62- . example ( "Ok" ) ,
63- value : jsonApi . Joi . any ( ) . optional ( )
64- . description ( "The current value of the tag in engineering units." )
65- . example ( "24.5" ) ,
66- rawValue : jsonApi . Joi . number ( ) . integer ( ) . optional ( )
67- . description ( "The current value of the tag in engineering units." )
68- . example ( "24" ) ,
69- input : jsonApi . Joi . any ( ) . optional ( )
70- . description ( "If tag is writeable, the value to write to the tag in engineering units." )
71- . example ( "24.5" ) ,
72- lastUpdate : jsonApi . Joi . date ( ) . optional ( )
73- . description ( "The last time the current value was updated in UNIX time (ms)." )
74- . example ( "1463776147123" ) ,
75- histDeadbandPercent : jsonApi . Joi . number ( ) . default ( .03 )
76- . description ( "The percent of change of value field required to trigger a history sample where .03 is 3%. 0 means collect everything." )
77- . example ( ".03" ) ,
78+ alarmStatus : jsonApi . Joi . string ( ) . optional ( )
79+ . description ( "Is the activeAlarm clear, acked, unacked." )
80+ . example ( "Clear, acked, unacked" ) ,
7881 activeAlarm : jsonApi . Joi . string ( ) . optional ( )
7982 . description ( "Is the tag in an alarm state based on an alarmDefs definition for the tag." )
8083 . example ( "None, HH, HI, LO, LL, INVALID" ) ,
@@ -84,9 +87,6 @@ jsonApi.define({
8487 alarmReset : jsonApi . Joi . boolean ( ) . default ( false )
8588 . description ( "If true the alarm has been reset." )
8689 . example ( "true" ) ,
87- alarmStatus : jsonApi . Joi . string ( ) . optional ( )
88- . description ( "Is the activeAlarm clear, acked, unacked." )
89- . example ( "Clear, acked, unacked" ) ,
9090 alarmDefId : jsonApi . Joi . string ( ) . optional ( )
9191 . description ( "If in alarm, then this will point to the alarm def id." ) ,
9292 device_id : jsonApi . Joi . allow ( null , '' ) . optional ( )
0 commit comments