Creating Custom Message Channels using Channel Editor

This section includes information about how to create the Standard and Trace channels and define the corresponding message types and formats using Channel Editor. Users can then use RtdbgSendMessageor the log methods generated by Channel Editor to send Standard or Trace messages with the configured message types and formats to Message Viewer.

To open Channel Editor, select the Channel Editor icon on the Message Viewer toolbar.

To start adding channels and configure the corresponding message formats:

  1. Open Channel Editor by selecting the Channel Editor icon on the toolbar of Message Viewer. The Open Configuration File window will appear. Choose a channels configuration file to edit. There are four options:

After choosing a file, its path will be displayed in the title bar. To choose another configuration file, select Open channels configuration file.

Note: The Message Viewer only uses CustomChannelsConfig.xml and IZChannelsConfig.xml to log channels. If the Message Viewer detects channel conflicts between these two files, the IZChannelsConfig.xml file will take priority.

Note: Channel conflicts arise if one of the following conditions occur:

The owner vendors have the same ID.
The owner products have the same ID.
The channel names or IDs are identical.

  1. Select to add a channel.
  1. Input a Vendor name and Vendor ID. Select Next.
    1. Existing vendor: If you have added vendors, you can select a vendor from the list.
    2. New vendor: Input a vendor name and ID. To prevent channel conflicts, please use the vendor's CustomerId from the wRTOS SDK license as its vendor ID. Vendor ID 0 is reserved for IntervalZero.
  2. Input a Product name and Product ID. Select Next.
    1. Existing product: If you have added products, you can select a product from the list.
    2. New product: Input a product name and ID. To prevent channel conflicts, please input a unique identifier for the product ID.
  3. Select a channel type and input a name and ID for this channel.
    1. Type: Select a channel type. There are two options, Standard and Trace. You can't change the type after it's been set through here.
    2. Channel name: Input a channel name. To prevent channel conflicts, please input a unique name.
    3. Channel ID: Input a channel ID. To prevent channel conflicts, please input a unique identifier.
  4. Select OK. The channel is added to the list located in the left pane.
  5. Repeat steps a-d to add more channels. You can add multiple products under a vendor and channels under a product.
  6. To edit or delete the created vendor, product or channel, right-click it on the list and select Edit or Delete. You can also add a vendor, product or channel through this method.
  1. Configure the message types and formats for the created channels. Select a channel from the list in the left pane. The corresponding setting tabs, including Properties, Message types, Enumerations, and Sources, are displayed in the right pane to configure.
  2. Select Apply to save the configuration file or select OK to save the configuration file and close Channel Editor. If you have enabled Automatically generate C++ code when configuration changes are applied in Code generation, C++ code will be automatically generated every time you select the OK or Apply button.
  3. Optionally import channels to the opened configuration file or export channels from the opened configuration file. See Import and Export Channels.

Properties

Select a channel from the list and then select the Properties tab. You can configure the basic information of a channel.

Message types

Select a channel from the list and then select the Message types tab. The settings will vary depending on the channel type. You can create message types to categorize messages and configure the corresponding formats and data entries. These configurations will be used by the Message Viewer when parsing the data sent by RtdbgSendMessage.

Standard Channel

TIP:  You can use the Move up or Move down buttons to arrange variables and paddings. The numbers beside represent the used and maximum data length. For example, 44/64 indicates that 44 bytes of data have been used out of a maximum of 64 bytes. You can configure the maximum data length in Properties.

Note: Variable names should be unique across all variables under the same format and follow C# variable naming rules (see Composite Formatting for more details). To prevent name conflicts when generating code, variable names must not end with _DATATYPE, _PRINTFORMAT or _ARRAY_ELEMENT_COUNT.

Trace Channel

Except for the following settings, the message type settings of Trace channels are essentially the same as those of Standard channels. See "Standard Channel" in Message Types.

Enumerations

Select a channel from the list and then select the Enumerations tab. You can create enumeration types for variables. For example, if you set a message format as The axis is in the {0} state, you can add an enumeration AxisState with a parameter Halt. The message will show:

The axis is in the Halt state

To add an enumeration type:

  1. Select to add an enumeration type. The ID for this enumeration type is automatically generated.

  1. Input a name in the Type name input box. The name must be unique across all enumeration types under the same channel and follow C# variable naming rules.
  2. To define this enumeration type, input a name and an integer value in the Enumeration values section. The name must be unique across all values in the enumeration type and follow C# variable naming rules. Select the Add value button. This value will be listed in the field below. Repeat this step to add more values.
  3. If you want to use an enumeration type defined outside of the tool for the tool to generate send message methods, select Use an external enum type for code generation, and the following two input boxes appear:
    • External enum type: Input a fully qualified name of the external enumeration for code generation, e.g., MyNamespace::MyEnum. Empty string is not allowed. This enumeration type will be used as the parameter in the generated send message method.
    • Header file for the enum: Input a header file name containing the external enumeration. The file name must have a ".h" extension (e.g., MyEnum.h). An include statement will be generated in the header file when activating Code Generation.

    Note: Once the external enumeration type is applied, the header file generated from Code Generation will no longer include the definition of the custom enumeration defined in Step 3.

  4. Select OK to add this enumeration type. You can select the created enumeration types when adding fixed type variables or array variables.

Sources

Select a channel from the list and then select the Sources tab. You can define source types for standard or trace messages. Each message can have a customized source to help users filter log messages.

To add a source type:

  1. Select and input a source name. The name must be unique across all sources under the same channel and follow C# variable naming rules.
  1. Select OK to add this source type.
  2. Repeat steps 1-2 to add more source types. The created source types will be displayed in the Sources field of Log Selection. Up to 32 sources can be added.

Code Generation

Select a product from the list to access the Code generation tab and generate C++ header and source files based on the product's configuration settings.

Import and Export Channels

Different applications have their own configuration files. To import channels from one file to another, use the Import channels function. To export channels from the opened configuration file, use the Export channels function.

Note: You can alternatively use the Channel Importer tool with the command line to import channels from one XML file to another.

To import channels to the opened configuration file:

  1. Select Import channels on the toolbar.

  1. Select Browse to choose a channels configuration file. You can enable Replace conflicting channels to force the replacement of conflicting channels.
  2. Select OK.

To export channels from the opened configuration file:

  1. Select Export channels on the toolbar.

  1. Choose the desired channels and select Next.
  2. Select a directory and input a file name. Select Save.