Model Validation (DATAFLOW Designer)
This Reference Article has been written for Version 2.1 of the DATAFLOW Software. For Previous Releases use the version selection in the navigation bar at the top of this page.
DATAFLOW Model Validation
The DATAFLOW Designer software performs a model validation prior to the code generation. The model is checked for consistency according to the rules explained below.
Severity
For every rule, a severity has been defined that will be visible in the generated message:
Info | These messages are informational and will not cause any issues in the generated code. | |
Warning | These messages indicate issues with the model that may lead to generated code that has unexpected behavior or does not compile. | |
Error | Errors indicate issues that will prevent code generation. |
If one or more errors are found, the code generation will not be executed and no files will be changed in the configured output directories.
Execute Model Validation
Validation is performed on generate Code (Ctrl + Shift + B).
There must be at least one Build Configuration defined in the project for code generation to be executed. When the code generation is completed, a dialog will show the result:
If there are 1 or more errors, no code will be generated at all.
A detailed list of all messages can be seen in the Message List Window (Show with Ctrl + Alt + M). Every rule has a numeric code so that it can be identified. The messages can be filtered by severity with the buttons on top of the window.
Deactivation of rules
Messages of the Info and Warning severity can be suppressed for a single model element or for the complete project. To suppress a message, click the right mouse button while the cursor points on the message. In the context menu, the message can be accepted for the given element or for the whole project:
Errors can not be accepted and must be fixed in the model.
Accept in Element
When a rule is accepted for an element, the same message will not be generated for that element when code generation is executed again (it may still be generated for other elements, and other messages will also be generated for the same element).
All disabled validation messages for an element can be inspected with the property inspector (Select element, right click -> select 'Properties' from the context menu).
Accept in Project
When a rule is accepted for the whole project, the same message will not be generated for any element when code generation is executed again.
All disabled validation messages for a project can be inspected in the Project Settings Dialog (Ctrl + K). Select the Validation page:
This page also allows to enable and disable any info and warning message for the project.
Rules
In this section, every rule is explained in detail. This includes:
- Number of the rule (in caption)
- Severity (I, W or E in caption)
- Name of the rule (in caption)
- Reason for the check
- How to fix the issue in your model
Numbers are defined as follows:
Digit 4 | Digit 3 | Digit 2 | Digit 1 |
Severity 1 Error 2 Warning 3 Info |
Category 0 General 1 Diagram 2 Data Type 3 Toolchain |
Message ID | Message ID |
General
E1000 - Invalid Name |
Severity: Error Message: <Element>: {name} is a reserved keyword and must not be used <Element>: {name} is a reserved keyword and must not Element: Any named element Rationale: This message is generated when a name is invalid and cannot be normalized to a valid name:
How to Fix: Change the name of the element to a valid name or remove the element. History: Added in V1.0 |
Remarks: See reserved Keywords for a complete list of all names that must not be used for model elements in DATAFLOW Designer (Reserved Keywords). |
E1001 - Value out of Range |
Severity: Error Message: <Enumerator>: identifier {ID} is outside base type {Type} range Element: Rationale: This message is used to indicate any kind of out of range values in the model. The message is generated when the identifier of an enumerator is outside of the range of the configured enumeration base type. The message is also generated when the lower or upper range of a type field is outside of the range of the configured data type. How to Fix: Change the value so that it is inside the data type or select a data type that supports the current value. It is also used for internal reference checks to detect configuration issues that cannot be achieved using the DATAFLOW Designer editors. If this message is generated outside of the context explained above, it is caused by a migration issue or a manual change of the project files outside DATAFLOW Designer (e.g. a version control merge issue). => Please report the issue to the DATAFLOW Support in this case so we can help to fix the project. History: Added in V1.0 |
Remarks: This message may be used for additional checks in the future. |
E1002 - Invalid Reference |
Severity: Error Message: <Port>: has protocol reference which is not generated
Element: Any element Rationale: This message is used to indicate any kind of elements that has an invalid reference configured. When a port references a protocol that has the Generate Code property disabled, this message is generated. How to Fix: Assign another protocol that is generated or enable Generate Code for the assigned protocol. It is also used for internal reference checks to detect configuration issues that cannot be achieved using the DATAFLOW Designer editors. If this message is generated outside of the context explained above, it is caused by a migration issue or a manual change of the project files outside DATAFLOW Designer (e.g. a version control merge issue). => Please report the issue to the DATAFLOW Support in this case so we can help to fix the project. History: Added in V1.0
|
Remarks: This message may be used for additional checks in the future. |
E1003 - No Content to Generate |
Severity: Error Message: <Active Container>: has no content to generate<Enumeration>: does not contain at least two enumerators Element: Active Container or Enumeration. Rationale: Certain elements require child elements in order to be generated:
How to Fix: Add the required child elements or remove the empty element if it is not required. If it is implemented later, the code generation can be disabled temporarily, see W2001. |
E1004 - Unsupported Type |
Severity: Error Message: <Driver>: No GPIO Type set Element: Any element Rationale: This message is used to indicate any kind of elements that have an unsupported type configured. For drivers, this is generated when the driver properties are not valid: How to Fix: For drivers, make sure that all properties are set to a valid value for the given driver type. It is also used for internal consistency checks to detect configuration issues that cannot be achieved using the DATAFLOW Designer editors. If this message is generated outside of the context explained above, it is caused by a migration issue or a manual change of the project files outside DATAFLOW Designer (e.g. a version control merge issue). => Please report the issue to the DATAFLOW Support in this case so we can help to fix the project. History: Added in V1.0, added driver messages in V1.4.
|
Remarks: This message may be used for additional checks in the future. |
E1005 - Duplicated Identifier |
Severity: Error Message: <Protocol>: duplicate protocol identifier found: {identifier} Element: Enumerations and Protocols Rationale: The event system of the DATAFLOW Runtime uses the message identifier to deserialize a received message from a byte buffer. If an identifier is not unique, deserialization may lead to unexpected results. Enumerations that use the same identifier for multiple enumerators will lead to a compiler error. How to Fix: Change the protocol identifiers so that every protocol has a unique identifier. History: Added in V1.0
|
Remarks: Use the automatic identifier generation to avoid conflicts. |
E1006 - Duplicated Name |
Severity: Error Message: <Element>: duplicate {element type} name found: {name} Element: Any named element, interrupt handlers. Rationale: Names must be unique in the model to avoid name collisions in the generated code. Interrupt handlers are global C-style functions and must be unique in the all components generated with the same Toolchain. Due to the fact that all generated classes will receive a suffix based on their type, elements of different types are allowed to share the same name. When 'Export Types to Global Namespace' is disabled (enabled by default) the same name can be used in different namespaces and no message is generated. How to Fix: Choose a unique name for every element. Disable export of all generated C++ types to global namespace so that the same name can be used in different namespaces. History: Added in V1.0. Added namespace check in V1.5.
|
Remarks: The default behavior will be changed to 'No Export to Global Namespace' in future versions. For existing project, this must be changed manually if required. |
E1007 - Invalid Identifier |
Severity: Error Message: TBD Element: TBD Rationale: TBD How to Fix: TBD History: Added in V2.0
|
Remarks: Future check, not active in V1.6. |
W2000 - Unused Reference |
Severity: Warning Message: <Terminator>: has no channels connected
Element: DATAFLOW Terminator Rationale: This message is used to indicate any element that references anything that they do not use. At the moment, this message is generated for an unconnected DATAFLOW Terminator element. How to Fix: In case of a DATAFLOW Terminator the element shall be connected or removed. It is also used for internal reference checks to detect configuration issues that cannot be achieved using the DATAFLOW Designer editors. If this message is generated outside of the context explained above, it is caused by a migration issue or a manual change of the project files outside DATAFLOW Designer (e.g. a version control merge issue). => Please report the issue to the DATAFLOW Support in this case so we can help to fix the project. History: Added in V1.0
|
Remarks: This message may be used for additional checks in the future. |
W2001 - Not generated Element |
Severity: Warning Message: <Component>: code generation is disabled
Element: Any component (System, System Component, Active Container, Active Part, Active Interrupt) Rationale: When the code generation is suppressed for a component, this warning message is generated. This should prevent that disabled parts of the model go unnoticed when code is generated. How to Fix: Enable code generation as soon as possible. History: Added in V1.0 |
I3000 - Normalized Names |
Severity: Info Message: <Element>: {normalized name} name was normalized (original name: ‘{element name}’)
Element: Any named element Rationale: Element names will be used in the generated code as names for classes, namespaces, methods and variables. Programming languages have strict rules on the allowed characters for such names (C++ Naming Rules). Therefore the names will be normalized on code generation:
When the name of an element does not match the normalized name (case sensitive) message 3000 is generated for that element. How to fix: Change the name to the normalized name. This improves traceability between model and code. History: Added in V1.0 |
I3001 - Protocol used as signal |
Severity: Info Message: <Protocol>: has no fields, used as signal
Element: Protocol Rationale: When a protocol has no fields, it is used as a signal. Signals are messages that contain only the identifier (2 bytes) and no payload. The name and description as well as the identifier are used for code generation. How to fix: No action required. If needed, the message can be disabled for the whole project, see above. History: Added in V1.0 |
Software and System Design
All error numbers with x1xx.
E1100 - Invalid Diagram Element |
Severity: Error Message: <Diagram>: contains {numberOfTimers} timers outside of an active part, none is allowed Element: DATAFLOW Diagram / System Context Diagram Rationale: Timers, ports and drivers shall be placed as child of components. When such elements are found in a diagram, code generation can not be performed. How to Fix: Delete all unused timers, ports and drivers or move to components. History: Added in V1.0. |
Remarks: Spacers and hardware interfaces have no effect on code generation. Therefore for these elements a warning is generated instead. See error 1200 (Comment AW: should this be linked to a warning instead of an error?) |
E1101 - Invalid Number of Input Ports |
Severity: Error Message: <Active Interrupt>: has {numberOfInputPorts} input ports, though none are allowed
Element: Active Interrupt Rationale: Active interrupts are not allowed to be used as receivers for events (except interrupts). Therefore they must never have an input port. How to Fix: Remove any input port from active interrupt components. History: Added in V1.0. |
E1102 - Invalid Channel Connection |
Severity: Error Message: <Channel Element>: has {N} incoming/outgoing channels, none allowed Element: Any element that can be connected to channels as well as channels itself. Rationale: All channel connections are validated and must be valid in order to generate code. Incorrect channel connections lead to a model that can not be generated. How to Fix: Fix the channel connection so that it fulfills all rules stated below. History: Added in V1.0. |
Remarks: See Channel Connection Rules article for more details (ADD LINK). |
E1103 - Missing Channel Connection |
Severity: Error Message: <Channel Element>: has no incoming/outgoing channels Element: Any element that can be connected to channels as well as channels itself. Rationale: All channel connections are validated and must be valid in order to generate code. Missing channels lead to a model that can not be generated. How to Fix: Fix the channel connection so that it fulfills all rules stated below. History: Added in V1.0. |
Remarks: See Channel Connection Rules article for more details (ADD LINK). |
E1104 - Invalid Child Element |
Severity: Error Message: <Element>: has an invalid child '{Child Name}' of type '{Type}'
Element: Any element Rationale: This message is used to indicate any kind of child element that is not allowed by the parent element. How to Fix: This is generated by an internal check to detect configuration issues that cannot be achieved using the DATAFLOW Designer editors. If this message is generated, it is caused by a migration issue or a manual change of the project files outside DATAFLOW Designer (e.g. a version control merge issue). => Please report the issue to the DATAFLOW Support in this case so we can help to fix the project. History: Added in V1.0. |
Remarks: This message may be used for additional checks in the future. |
W2100 - Unexpected diagram element |
Severity: Warning Message: <Diagram>: contains {numberOfHardwareInterfaces} hardware interfaces outside of an active part or container Element: DATAFLOW Diagram / System Context Diagram Rationale: Spacers and hardware interfaces should be placed as child of components. When such elements are found in a diagram, it is assumed that the user has not deleted them after a diagram refactoring. How to Fix: Delete all unused spacers and hardware interfaces or move to components. History: Added in V1.0. |
Remarks: Spacers and hardware interfaces have no effect on code generation. Therefore for these elements a warning is generated. See error 1100 for other elements. |
W2101 - No protocol assigned to port |
Severity: Warning Message: <Port>: has no protocol assigned
Element: DATAFLOW Port Rationale: When a port has no protocol assigned, no message can be sent using that port. How to Fix: Remove the port if it is not required. Assign an existing protocol to the port or create a new one. History: Added in V1.0. |
Remarks: This message is generated for any port that has no protocol assigned. This includes input and output ports on all components that support ports as child element (active part, active interrupt and active container). |
W2102 - Active part has no input port |
Severity: Warning Message: <Active Part>: has neither an input port nor a timer
Element: Active Part Rationale: An Active Part has no input port - this indicates an incomplete model. The active part will never receive any messages and will therefore never be called. How to Fix: Add an input port and connect at least one channel to it. Add a timer or hardware interface to the Active Part. History: Added in V1.0. |
Remarks: When an Active Part contains at least one timer, driver or hardware interface, this message is not generated. It is assumed that the Active Part will be called by a timer / driver event or notified by means outside the DATAFLOW Runtime. |
W2103 - Active interrupt has no output port |
Severity: Warning Message: <Active Interrupt>: has no output port(s)
Element: Active Interrupt Rationale: When an Active Interrupt does not contain any output port, the software does not handle the interrupt. The model is therefore considered incomplete: How to Fix: Remove the Active Interrupt if it is not required. If the interrupt shall be handled, add at least one output port to the Active Interrupt and assign a protocol to it. Connect the port to the input port of the handling component. If the interrupt is handled outside the DATAFLOW event system (for performance reasons e.g. ring buffer, queue) the message can be disabled for this element. This should be properly documented in the architecture documentation of the developed software. History: Added in V1.0. |
W2104 - Portin has no incomming channel |
Severity: Warning Message: <Port>: has no incoming channels connected
Element: DATAFLOW Port (Input) Rationale: An input port that has no channels connected indicates an incomplete model. The active part with this input port will never receive any messages and will therefore never be called. How to Fix: Connect at least one channel to the input port. If the input port is not required, remove it. The Active Part should have at least one timer so that it is called. Otherwise this will lead to warning 2102. History: Added in V1.0. |
Remarks: Also see warning 2102. |
W2105 - Port out has no outgoing channel |
Severity: Warning Message: <Port>: has no outgoing channels connected
Element: DATAFLOW Port (Output) Rationale: An output port that has no channels connected indicates an incomplete model. A message sent on this port will never be handled by any other component in the system. How to Fix: Remove the port if it is not used or connected a channel to the port so that the message can be handled. History: Added in V1.0. |
W2106 - Conflicting priorities |
Severity: Warning Message: <Port>: port input split connects to different priorities
Element: Inherited DATAFLOW Port (Input) Rationale: TBD How to Fix: TBD History: Added in V1.3. |
W2107 - Conflicting protocols |
Severity: Warning Message: <Port>: receives {protocolCount} different protocols, all connected ports should send the same protocol
Element: Inherited DATAFLOW Port (Output) Rationale: This message is generated when different protocols are connected to the same output port of an active container: An output port should always have a single protocol. This ensures that the connections in the parent diagram can be made based on the message. This makes sure that no messages are sent to Active Parts that do not need to handle them. How to Fix: Create one output port per protocol and change the names to reflect the purpose of the ports better. History: Added in V1.3.
|
Data Type Design
All error numbers with x2xx.
E1200 - Field must not be an array |
Severity: Error Message: <Field>: must not be an array
Element: Type Field Rationale: This message indicates that a field of a user defined data type must be a scalar but is an array. How to Fix: Change the field type to a scalar. History: Added in V1.0, Removed in V1.6. |
Remarks: This message cannot be generated in the current version of the DATAFLOW Designer because all fields support array and scalar data types. |
E1201 - Field must not have a range |
Severity: Error Message: <Field>: must not have a range
Element: Type Field Rationale: Indicates that a range has been defined for a field that does not support ranges in code generation. In V1.6, the following SCALAR field types may have ranges:
For any other field type (bool, float, enum, protocol) or to array fields, defining a range will lead to this error. How to Fix: Remove the range from the field or change the data type of the field to a type that supports ranges. History: Added in V1.0 |
E1202 - Field must be an array |
Severity: Error Message: <Field>: must be an array
Element: Type Field Rationale: This message indicates that a field of a user defined data type must be an array - but it is a scalar. How to Fix: Change the field type to an array. History: Added in V1.0, Removed in V1.6. |
Remarks: This message cannot be generated in the current version of the DATAFLOW Designer because all fields support array and scalar data types. |
E1203 - Invalid Data Type |
Severity: Error Message: <Driver>: no driver type set
Element: Any element Rationale: This message is used to indicate any kind of element that has a data type configured that is not expected. How to Fix: This message is generated from internal consistency checks to detect configuration issues that cannot be achieved using the DATAFLOW Designer editors. If this message is generated, it is caused by a migration issue or a manual change of the project files outside DATAFLOW Designer (e.g. a version control merge issue). => Please report the issue to the DATAFLOW Support in this case so we can help to fix the project. History: Added in V1.0 |
Remarks: This message may be used for additional checks in the future. |
E1204 - Field must be a protocol |
Severity: Error Message: <Protocol>: protocol field '{name}' can not be a signal.
Element: Protocol Rationale: When a protocol with no fields (handled as signal) is used as type for a field, this cannot be generated. How to Fix: Remove the signal or add fields to the signal. History: Added in V1.0
|
E1205 - Protocol Type Size too Large |
Severity: Error Message: <Protocol>: protocol size {Size} bytes exceeds the maximum of 65535 bytes.
Element: Protocol Rationale: When a protocol is larger than the maximum size of the event buffer (65535 Bytes in DATAFLOW Runtime Version 2.7), it will cause a Runtime assertion when it is sent in the generated code. How to Fix: Remove fields from the protocol. Consider to split the message up into different protocols. It is also not recommended to send very large messages over the DATAFLOW event system. Consider to place the data in a memory buffer and only send a small status message that notifies the receiver that the data is ready. In this way, the event buffer can be smaller and the read/write access to the data is still coordinated between Active Parts. History: Added in V1.5 |
Remarks: Depending on the configured EVENT_DATA_SIZE_MAX in the Toolchain configuration, an assert may still be triggered when the protocol is larger. Therefore we recommend to not manually overwrite the size for a single event. |
E1206 - Custom Type Size to Large |
Severity: Error Message: TBD Element: TBD Rationale: TBD How to Fix: TBD History: Added in V2.0 |
Remarks: Future check, not active in V1.6. |
W2200 - Empty Type Group |
Severity: Warning Message: <Type Group>: contains no elements.
Element: Type Group Rationale: Type groups can be nested to group the defined data types in sub namespaces. If a group contains no child groups and no data types, this message is generated for the given group. How to fix: Remove the type group. It has no benefit to keep an empty type group in the model. History: Added in V1.0 |
W2201 - Enum Base Type Int64 |
Severity: Warning Message: <Enumeration>: base type int64 is not supported by all C++98 compilers.
Element: Enumeration Rationale: In C++ the 8 byte signed integer data type was not part of the C++:98 / 03 standard. Therefore not all compilers support the data type. How to fix: If a newer compiler is used or if the type is supported, this warning can be disabled in the project settings so that enumerations can use an Int64 base type with no warnings. If the used compiler does not support the data type, UInt64 should be used instead. History: Added in V1.5 |
Remarks: In future versions, we may only generate this message if a Toolchain is configured to use C++:98 / 03 explicitly and suppress it for C++:11 or newer. |
Toolchain
All error numbers with x3xx.
E1300 - Invalid Root Element |
Severity: Error Message: <Software Container>: is not generated as a software component and must not have a toolchain
Element: Software Container (System, Active Container or System Component) Rationale: The root container of the generated software must contain valid level 1 components to generate. Otherwise a Toolchain must not be assigned to that container. A valid root software container contains:
How to Fix: History: Added in V1.4 |
Remarks: The system element can qualify as software container for software only projects if it fulfills the rules stated above. The presence of system components as children of the root container does not prevent a Toolchain from being used. These elements will be ignored in code generation and may be used for documentation purposes. |
E1301 - Nested Toolchain |
Severity: Error Message: <Software Container>: is child of a software container with toolchain and must not have its own toolchain
Element: Software Container (Active Container or System Component) Rationale: A Toolchain will generate the software container it is assigned to and all its child components. When one of these child components is a container itself and also has a Toolchain assigned, the code generation will lead to conflicts. Therefore, this is not allowed. How to Fix: Remove the Toolchain from the child container. The Toolchain must always be added on the top most software container that shall be generated. History: Added in V1.4 |
Required Module: DATAFLOW Designer, DATAFLOW Code
This Article has been written based on V2.1.1 of the DATAFLOW software.
Latest update 2023-06-01 by WUM.
Comments
0 comments
Please sign in to leave a comment.