Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Condition ID format and example not matching on Agent version 2.3? #444

Open
hulinning2 opened this issue Apr 22, 2024 · 6 comments
Open
Assignees

Comments

@hulinning2
Copy link
Collaborator

Based on readme document of version 2.3, the SHDR format of CONDITION only has 6 fields but, in the example, it shows 7 data fields (not included time stamp).
Is that correct?

<timestamp>|<data_item_name>|<level>|<native_code>:<condition_id>|<native_severity>|<qualifier>|<message>

2014-09-29T23:59:33.460470Z|htemp|WARNING|HTEMP-1-HIGH|HTEMP|1|HIGH|Oil Temperature High**

image

I got errors when validating the current output with schema as shown below that require condition ID:
2024-04-22T18:49:48.2554602Z|UserMessage1||UNAVAILABLE
2024-04-22T18:49:48.2554602Z|system|NORMAL|3|4|5|6
2024-04-22T18:49:48.2554602Z|CoolantSystem1_cond|UNAVAILABLE||||
2024-04-22T18:49:48.2554602Z|ElectricSystem1_cond|UNAVAILABLE||||
2024-04-22T18:49:48.2554602Z|HydraulicSystem1_cond|UNAVAILABLE||||
2024-04-22T18:49:48.2554602Z|LubricationSystem1_cond|UNAVAILABLE||||
2024-04-22T18:49:48.2554602Z|PneumaticSystem1_cond|UNAVAILABLE||||
2024-04-22T18:49:48.2554602Z|LoaderSystem1_cond|UNAVAILABLE||||
2024-04-22T18:49:48.2554602Z|WasteDisposalSystem1_cond|UNAVAILABLE||||
2024-04-22T18:49:48.2554602Z|ToolingDeliverySystem1_cond|UNAVAILABLE||||
2024-04-22T18:49:48.2554602Z|BarFeederSystem1_cond|UNAVAILABLE||||

File http://localhost:5000/current is not valid.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.
Attribute 'conditionId' is required in element .
Annotations of element 'Normal' (see below)
{{term(condition state)}} that indicates operation within specified
limits.
Annotations of type 'NormalType' (see below)
{{term(condition state)}} that indicates operation within specified
limits.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Normal
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'NormalType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'NormalType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Normal' failed.`

@wsobel
Copy link
Member

wsobel commented Apr 22, 2024

The nativeCode and conditionId are separated by a colon (:) not by a pipe (|)

@hulinning2
Copy link
Collaborator Author

This means the sample shdr in the document is not correct because there is no colon. Is that correct?

2014-09-29T23:59:33.460470Z|htemp|WARNING|HTEMP-1-HIGH|HTEMP|1|HIGH|Oil Temperature High

@wsobel
Copy link
Member

wsobel commented Apr 22, 2024

The example is wrong. There should not be the extra field. Missed that. I'll ask Dave to fix the docs.

There should only be 6 field not 7.

@hulinning2
Copy link
Collaborator Author

It seems agent does not produce the data stream correctly or the schema is not correct.

I got invalid conditionId value of 1700 when validating with XMLSpy.

shdr data:
2024-04-23T15:15:17.3726547Z|system|FAULT|1700:1700|1700|HIGH|1700 ALARM_A 1

current output:
<Condition> <Fault conditionId="1700" dataItemId="Lsystem" name="system" nativeCode="1700" nativeSeverity="1700" qualifier="HIGH" sequence="1132" timestamp="2024-04-23T15:12:13.071944Z" type="SYSTEM">1700 ALARM_A 1</Fault> </Condition>

XMLSpy Error:
Value '1700' is not allowed for attribute 'conditionId'.
Annotations of attribute 'conditionId' (see below)
Identifier of an individual condition activation provided by a
piece of equipment
Annotations of type 'IDType' (see below)
An identifier
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Fault / @conditionId
Details
cvc-datatype-valid.1.2.1: For type definition 'IDType' the string '1700' does not match a literal in the lexical space of built-in type definition 'xs:ID'.
cvc-simple-type.1: For type definition 'IDType' the string '1700' is not valid.
cvc-attribute.3: Value '1700' of attribute 'conditionId' does not match simple type definition 'IDType'.
cvc-assess-elt.2: Assessment of attribute 'conditionId' failed.

@hulinning2
Copy link
Collaborator Author

It seems missing conditionId in the data stream

2024-04-23T15:15:17.3726547Z|CoolantSystem1_cond|UNAVAILABLE||||

<Condition> <Unavailable dataItemId="LCoolantSystem1_cond" name="CoolantSystem1_cond" sequence="970" timestamp="2024-04-23T15:00:06.723365Z" type="SYSTEM"/> </Condition>

Error:
Attribute 'conditionId' is required in element .
Annotations of element 'Unavailable' (see below)
The conditon can not be determined.
Annotations of type 'UnavailableType' (see below)
The conditon can not be determined.
Error location: MTConnectStreams / Streams / DeviceStream / ComponentStream / Condition / Unavailable
Details
cvc-complex-type.4: Required attribute 'conditionId' is missing from element .
cvc-type.3.2: Element is not valid with respect to type definition 'UnavailableType'.
cvc-elt.5: The element is not valid with respect to the actual type definition 'UnavailableType'.
cvc-assess-elt.1.1: Strict assessment of element with governing element declaration 'Unavailable' failed.

@wsobel
Copy link
Member

wsobel commented Apr 23, 2024

It should be a string type not an id type. Shaurabh should fix it in the schema generator.

Thanks for finding this! - W

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants