SetCategoryName
Sets a string to associate to a log ID.
Syntax
KsError SetCategoryName(
int Category,
wchar_t* Name
);
Parameters
Category: the ID you want to assign this name to. The ID doesn't have to start from zero or in sequence.
Name: a human-readable string that describes the ID. Limited to 64 characters.
Return value
If the function succeeds, it returns errNoError
, otherwise an error code. For more information about the error code, see the KsError list.
Remarks
- After you associate a string to a Category, Name will be displayed in KINGSTAR Analysis Console instead of the Category. It is easy to identify what a log is for this way.
- The Name string uses UTF-16 encoding.
Usable EtherCAT states
ecatOffline, ecatInit, ecatBoot, ecatPreOP, ecatSafeOP, ecatOP
Example
Copy
/*
* Assume an user-defined enumeration:
*
* typedef enum
* {
* userMain = 0,
* userCommander,
* userObserver,
* END_USERMODULE
* } userModule;
*/
nRet = SetCategoryName(userMain, L"Main loop");
nRet = SetCategoryName(userCommander, L"Commander class");
nRet = SetCategoryName(userObserver, L"Observer class");
Requirements
RT | Win32 | |
---|---|---|
Minimum supported version | 4.1 | 4.1 |
Header | ksapi.h | ksapi.h |
Library | KsApi_Rtss.lib | KsApi.lib |
See also