Classes | |
class | MlpiReadEverythingDataAccess |
This module contains some useful functions and macros for parameter handling.
Please note that this piece of source code is not directly part of the MLPI. You do not need this file to program against the MLPI. Nevertheless, at least parts of this file have been considered to be somewhat useful when using or learning to use MLPI functionality. It is therefore included without any support, but to act as sample code and source of inspiration.
class MlpiReadEverythingDataAccess |
This class helps to access the data read via the 'mlpiParameterReadEverything' function.
Definition at line 1289 of file mlpiParameterHelper.h.
This Function extracts the data type which is coded in Sercos attribute and translates it the an MLPI data type of the enum MlpiType.
[in] | attribute | Sercos attribute |
In most cases, it's too difficult to know the correct data type for a parameter request. This function can help. It takes the original attribute of a parameter and converts it to a type you can use for a parameter request.
Definition at line 400 of file mlpiParameterHelper.h.
References MLPI_TYPE_CHAR, MLPI_TYPE_CHAR_UTF16, MLPI_TYPE_DOUBLE, MLPI_TYPE_DOUBLE_ARRAY, MLPI_TYPE_FLOAT, MLPI_TYPE_FLOAT_ARRAY, MLPI_TYPE_INVALID, MLPI_TYPE_LLONG, MLPI_TYPE_LLONG_ARRAY, MLPI_TYPE_LONG, MLPI_TYPE_LONG_ARRAY, MLPI_TYPE_SHORT, MLPI_TYPE_SHORT_ARRAY, MLPI_TYPE_UCHAR, MLPI_TYPE_UCHAR_ARRAY, MLPI_TYPE_ULLONG, MLPI_TYPE_ULLONG_ARRAY, MLPI_TYPE_ULONG, MLPI_TYPE_ULONG_ARRAY, MLPI_TYPE_USHORT, and MLPI_TYPE_USHORT_ARRAY.
This Function extracts the 'procedure command' property which is coded in Sercos attribute.
[in] | attribute | Sercos attribute. |
Definition at line 463 of file mlpiParameterHelper.h.
This Function extracts the places after decimal point which is coded in Sercos attribute.
[in] | attribute | Sercos attribute. |
Definition at line 478 of file mlpiParameterHelper.h.
|
inline |
This Function extracts the write protection of a parameter in certain states which is coded in Sercos attribute.
[in] | attribute | Sercos attribute. |
Definition at line 507 of file mlpiParameterHelper.h.
|
inline |
This function parses a Sercos IDN string and returns its properties. These can be used to build a binary expression of the Sercos IDN.
[in] | idn | String representation of a Sercos parameter IDN. For example "S-0-0051", "S-0-1050.0.1" or "P-100". |
[out] | address | Pointer to a variable which receives the address. |
[out] | type | Pointer to a variable which receives the type. |
[out] | set | Pointer to a variable which receives the set element. |
[out] | block | Pointer to a variable which receives the block. |
[out] | si | Pointer to a variable which receives the si element. |
[out] | se | Pointer to a variable which receives the se element. |
[out] | idnNxt | Pointer to the first character after parsed Sercos IDN string. |
Definition at line 542 of file mlpiParameterHelper.h.
References MLPI_E_INVALIDARG, MLPI_S_OK, MLPI_SIDN_TYPE_AXIS, MLPI_SIDN_TYPE_CONTROL, MLPI_SIDN_TYPE_DRIVE_P, MLPI_SIDN_TYPE_DRIVE_S, MLPI_SIDN_TYPE_KINEMATIC, MLPI_SIDN_TYPE_OSCILLOSCOPE, MLPI_SIDN_TYPE_POSLIMSWITCH, MLPI_SIDN_TYPE_PROBE, wcschr16(), wcslen16(), and wtoi16().
Referenced by utilParameterParseIdn().
|
inline |
This function parses a Sercos IDN string and returns its binary expression.
[in] | idnString | String representation of a Sercos parameter IDN. For example, "S-0-0051", "S-0-1050.0.1" or "P-100". |
[out] | idnValue | Pointer to a variable which receives the binary expression of the given string. This can be used for subsequent calls to ParameterRead functions. |
[out] | address | Pointer to a variable which receives the address. |
Definition at line 684 of file mlpiParameterHelper.h.
References MLPI_SIDN, and utilParameterParseIdn().
|
inline |
Some SIDNs contain the address field in the upper byte of the reserved space. Use this function to cut out the address from the rest of the SIDN. See for example parameters like A-0-0002 or O-0-0003.
[in] | sidn | Sercos IDN, in format as from O-0-0003. |
[out] | idn | Pointer to a variable which receives the binary expression of the given SIDN. This can be used for subsequent calls to ParameterRead functions. |
[out] | address | Pointer to a variable which receives the address. |
Definition at line 712 of file mlpiParameterHelper.h.
References MLPI_S_OK, MLPI_SIDN_BLOCK_MASK, MLPI_SIDN_SE_MASK, MLPI_SIDN_SET_MASK, MLPI_SIDN_SI_MASK, and MLPI_SIDN_TYPE_MASK.
Referenced by utilParameterParseIdn().
|
inline |
This function splits a sercos SIDN and returns its properties. Some SIDNs contain the address field in the upper byte of the reserved space (see for example parameters such as A-0-0002 or O-0-0003). Use this function to cut out the address from the rest of the SIDN as well as all other elements within a SIDN.
[in] | sidn | SIDN which should be split. |
[out] | address | Pointer to a variable which receives the address. |
[out] | type | Pointer to a variable which receives the type. |
[out] | block | Pointer to a variable which receives the block. |
[out] | spFlag | Pointer to a variable which receives the S or P flag. |
[out] | set | Pointer to a variable which receives the set element. |
[out] | si | Pointer to a variable which receives the si element. |
[out] | se | Pointer to a variable which receives the se element. |
Definition at line 749 of file mlpiParameterHelper.h.
References MLPI_S_OK.
|
inline |
This function parses a address and returns a sercos IDN string.
[in] | address | 64 Bit value of an EIDN. |
[out] | idnString | Pointer to a variable which receives the string. Use define PARAM_MAX_IDN_STRING_LENGTH for creation. |
[in] | numElements | Number of WCHAR16 elements in 'idnString' available to read. |
Definition at line 796 of file mlpiParameterHelper.h.
References mbstowcs16(), MLPI_SIDN_TYPE_AXIS, MLPI_SIDN_TYPE_CONTROL, MLPI_SIDN_TYPE_DRIVE_S, MLPI_SIDN_TYPE_KINEMATIC, MLPI_SIDN_TYPE_OSCILLOSCOPE, MLPI_SIDN_TYPE_POSLIMSWITCH, MLPI_SIDN_TYPE_PROBE, PARAM_MAX_IDN_STRING_LENGTH, utilParameterSplitSidn(), wcscat16(), wcscpy16(), and wcslen16().
|
inline |
This function parse a 64-bit sercos time value and returns a sercos time string (CHAR). Structure of sercos time Bit 63-32: seconds since 1970-01-01, 00:00:00 Nit 31-00: nanoseconds up to 999.999.999.
[in] | timeStamp | 64-bit sercos time value. |
[out] | time | Pointer to a variable which receives the sercos time string (ISO-8601). Use define PARAM_SERCOS_TIME_STRING_LENGTH for creation. |
[in] | numElements | Number of CHAR elements in 'time' available to write. |
[in] | numElementsRet | Number of CHAR elements in complete 'time'. |
Definition at line 901 of file mlpiParameterHelper.h.
References MLPI_E_BUFFERTOOSHORT, MLPI_E_INVALIDARG, MLPI_E_LIMIT_MAX, MLPI_E_UNIMPLEMENTED, MLPI_S_OK, and PARAM_SERCOS_TIME_STRING_LENGTH.
Referenced by utilParameterParseSercosTimeToString().
|
inline |
This function parse a 64-bit sercos time value and returns a sercos time string (CHAR). Structure of sercos time Bit 63-32: seconds since 1970-01-01, 00:00:00 Nit 31-00: nanoseconds up to 999.999.999.
[in] | timeStamp | 64-bit sercos time value. |
[out] | time | Pointer to a variable which receives the sercos time string (ISO-8601). Use define PARAM_SERCOS_TIME_STRING_LENGTH for creation. |
[in] | numElements | Number of WCHAR16 elements in 'time' available to write. |
[in] | numElementsRet | Number of WCHAR16 elements in complete 'time'. |
Definition at line 976 of file mlpiParameterHelper.h.
References mbstowcs16(), MLPI_S_OK, PARAM_SERCOS_TIME_STRING_LENGTH, and utilParameterParseSercosTimeToString().
|
inline |
This function parse a sercos time string (CHAR) and returns a 64-bit sercos time value. Structure of sercos time Bit 63-32: seconds since 1970-01-01, 00:00:00 Nit 31-00: nanoseconds up to 999.999.999.
[in] | time | Pointer to a variable which contains at least one sercos time string (ISO-8601). |
[in] | separator | Separator between two or more sercos time strings. Use space character at default. |
[out] | timeStamp | 64-bit sercos time value. |
[out] | timeNext | Pointer next sercos time string. |
Definition at line 1012 of file mlpiParameterHelper.h.
References MLPI_E_INVALIDARG, MLPI_E_UNIMPLEMENTED, MLPI_S_OK, MLPI_SUCCEEDED, and PARAM_SERCOS_TIME_STRING_LENGTH.
Referenced by utilParameterParseStringToSercosTime().
|
inline |
This function parse a sercos time string (WCHAR16) and returns a 64-bit sercos time value. Structure of sercos time Bit 63-32: seconds since 1970-01-01, 00:00:00 Nit 31-00: nanoseconds up to 999.999.999.
[in] | time | Pointer to a variable which contains at least one sercos time string (ISO-8601). |
[in] | separator | Separator between two or more sercos time strings. Use space character at default. |
[out] | timeStamp | 64-bit sercos time value. |
[out] | timeNext | Pointer next sercos time string. |
Definition at line 1242 of file mlpiParameterHelper.h.
References MLPI_E_INVALIDARG, MLPI_S_OK, MLPI_SUCCEEDED, PARAM_SERCOS_TIME_STRING_LENGTH, and utilParameterParseStringToSercosTime().