Set a name for a user message

When you use a message, you'll want to set a name for this message in order to identify what this message indicates. You can use SetCategoryName to set its name. It's easy to set, just enter an ID and the name and it's done. Because SetCategoryName uses wide characters for the name, you need to type "L" before the name string, which can be English, Chinese, or other language.

The following code is written in the function DebugMessages.

  1. Use SetCategoryName to set names for messages. In this guide we set three.
  2. Copy
    //Set log IDs and names.
    SetCategoryName(0, L"Temperature");
    SetCategoryName(1, L"Voltage");
    SetCategoryName(2, L"Warning");
  3. Start KINGSTAR Analysis Console and click Standard's Start (green triangle next to Standard).
  4. Run the code above.
  5. In KINGSTAR Analysis Console, click Log selection.
  6. On Standard Messages page, scroll down to see User message categories. You'll see the names we set are displayed under Specify. Click Specify.
  7. Clear all the value in Category indexes.
  8. Select the check boxes under Specify. You'll see the indexes under the names correspond to the ID you set in the code.