Stream cases are used to provide structure to a data elements of type Stream or Short Stream. A selector value determines which defined type is used, that is, which stream case applies.
There are a few restrictions, when using Stream cases:
- Stream Cases must not contain Stream Signals.
- The selector value itself must not be part of the Stream it controls.
- The selector value must be in front of the Stream it controls.
- The selector of a composed stream may be embedded in another stream.
- It is recommended to transmit the stream selector and the corresponding stream in the same message. For example, a partial update containing a stream case without the stream selector should be avoided.
-
The selector value must be based on one of the following data types:
- Enum
- Unsigned Byte
- Signed Byte
- Unsigned Word
- Signed Word
- Unsigned Long
- Signed Long
- Unsigned Long Long
- Signed Long Long
- Short Stream
- Repeated Stream parameters must not be used in Stream Cases.
- The selector of a Stream must not be a repeated data element.
- Repeated elements, for example, are repeated Stream parameters and array elements.
The example below shows a composed Stream, where the condition for the individual stream cases is based on an Unsigned Byte parameter UnsignedByteParam_Selector. In the second Stream case, a simple Stream is embededded. This simple (i.e., it does not contain Stream cases) Stream has an embedded Unsigned Byte parameter.