Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4COM)  1.26.2
IParameter Interface Reference

Inherits IDispatch.

Collaboration diagram for IParameter:
Collaboration graph

Classes

struct  ParameterListLength
 

Public Member Functions

HRESULT ReadData ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] VARIANT *data)
 
HRESULT ReadMinimum ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] VARIANT *data)
 
HRESULT ReadMaximum ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] VARIANT *data)
 
HRESULT ReadDefault ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] VARIANT *data)
 
HRESULT ReadName ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] BSTR *data)
 
HRESULT ReadUnit ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] BSTR *data)
 
HRESULT ReadDataStatus ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] VARIANT_BOOL *data)
 
HRESULT ReadAttribute ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] VARIANT *data)
 
HRESULT Command ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se)
 
HRESULT WriteData ([in] VARIANT data, [in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se)
 
HRESULT ReadListLength ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] struct ParameterListLength *listLength)
 
HRESULT ReadDataAsString ([in] BSTR idn, [in, optional] VARIANT address, [in, optional] VARIANT set, [in, optional] VARIANT block, [in, optional] VARIANT si, [in, optional] VARIANT se, [out, retval] BSTR *data)
 

Detailed Description

Definition of the IParameter interface used to access the parameter system of the MLPI Device.

Use the IParameter interface to access parameters on the MLPI device or its slave devices, which are connected to the MLPI device.

Definition at line 71 of file IParameter.idl.

Member Function Documentation

HRESULT IParameter::ReadData ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] VARIANT *  data 
)

Reads a parameter and returns its content.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]dataReturn value containing the parameter data requested.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// specify address as string:
object x1 = connection.Parameter.ReadData("C-0-012", null, null, null, null, null);
// the following line is equivalent to the one above, but uses optional integer arguments to specify the address:
object x2 = connection.Parameter.ReadData("C", 0, 0, 12, 0, 0);
// this is useful when programming loops to read parameters
Console.WriteLine("Parameter Data: " + x1.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadData, where you can find further documentation.
HRESULT IParameter::ReadMinimum ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] VARIANT *  data 
)

Reads the minimum value of a SERCOS parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]dataReturn value containing the parameter information requested.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// specify address as string:
object x1 = connection.Parameter.ReadMinimum("C-0-0001", null, null, null, null, null);
// the following line is equivalent to the one above, but uses optional integer arguments to specify the address:
object x2 = connection.Parameter.ReadMinimum("C", 0, 0, 1, 0, 0);
// this is useful when programming loops to read parameters
Console.WriteLine("Minimum Value: " + x1.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadMinimum, where you can find further documentation.
HRESULT IParameter::ReadMaximum ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] VARIANT *  data 
)

Reads the maximum value of a SERCOS parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]dataReturn value containing the parameter information requested.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// specify address as string:
object x1 = connection.Parameter.ReadMaximum("C-0-0001", null, null, null, null, null);
// the following line is equivalent to the one above, but uses optional integer arguments to specify the address:
object x2 = connection.Parameter.ReadMaximum("C", 0, 0, 1, 0, 0);
// this is useful when programming loops to read parameters
Console.WriteLine("Maximum Value: " + x1.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadMaximum, where you can find further documentation.
HRESULT IParameter::ReadDefault ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] VARIANT *  data 
)

Reads the default value of a SERCOS parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[in]dataReturn value containing the parameter information requested.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// specify address as string:
object x1 = connection.Parameter.ReadDefault("C-0-0001", null, null, null, null, null);
// the following line is equivalent to the one above, but uses optional integer arguments to specify the address:
object x2 = connection.Parameter.ReadDefault("C", 0, 0, 1, 0, 0);
// this is useful when programming loops to read parameters
Console.WriteLine("Default Value: " + x1.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadDefault, where you can find further documentation.
HRESULT IParameter::ReadName ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] BSTR *  data 
)

Reads the name of a SERCOS parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]dataReturn value containing the parameter name requested as string.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// get name of parameter
string parameterName = connection.Parameter.ReadName("C-0-0001", null, null, null, null, null);
Console.WriteLine("Parameter Name: " + parameterName);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadName, where you can find further documentation.
HRESULT IParameter::ReadUnit ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] BSTR *  data 
)

Reads the unit of a SERCOS parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]dataReturn value containing the parameter unit requested as string.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// get unit of temperature parameter
string parameterUnit = connection.Parameter.ReadUnit("C-0-0070", null, null, null, null, null);
// print unit to console
Console.WriteLine("Parameter Unit: " + parameterUnit);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadUnit, where you can find further documentation.
HRESULT IParameter::ReadDataStatus ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] VARIANT_BOOL *  data 
)

Reads the data status of a SERCOS parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]dataReturn value containing the parameter requested.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// get data status of temperature parameter
bool dataStatus = connection.Parameter.ReadDataStatus("C-0-0070", null, null, null, null, null);
// print unit to console
Console.WriteLine("Data Status: " + dataStatus.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadDataStatus, where you can find further documentation.
HRESULT IParameter::ReadAttribute ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] VARIANT *  data 
)

Reads the attribute of a SERCOS parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]dataReturn value containing the parameter attribute requested.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// get attribute of temperature parameter
uint attribute = (uint)connection.Parameter.ReadAttribute("C-0-0070", null, null, null, null, null);
// print unit to console
Console.WriteLine("Attribute: " + attribute.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadAttribute, where you can find further documentation.
HRESULT IParameter::Command ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se 
)

Executes a parameter command.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// call parameter to clear error
connection.Parameter.Command("C-0-1030", null, null, null, null, null);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterCommand, where you can find further documentation.
HRESULT IParameter::WriteData ( [in] VARIANT  data,
[in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se 
)

Writes a SERCOS parameter. Please ensure that the given argument for the parameter data matches the attribute of the parameter. This means, for example, that it is illegal to write a float value to a non-floating point parameter. Otherwise this function will return an error.

Parameters
[in]dataInput data to be written on the parameter.
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
Returns
Return value indicating success (>=0) or error (<0).
Note
As mentioned above this function only accepts the proper data type for the argument data. There are two possibilities to meet this restriction:
First of all the argument data can be given as variable matching the attribute of the parameter. This is shown in the upper part of the example.
Secondly and the alternative if the data type is not known, the argument data can be given as string. In this case the function converts the string automatically into the proper data type. This is shown in the lower part of the example and is only possible if the conversion is possible.

The argument data should under no circumstances be given as plain number, because the data type assumed by the compiler would probably not match the attribute of the parameter.
Example C#
try
{
// argument data is given as variable matching the attribute of the parameter:
ushort data = 0;
connection.Parameter.WriteData(data, "C-0-0805", null, null, null, null, null);
// the following line is equivalent to the one above, but uses optional integer arguments to specify the address:
connection.Parameter.WriteData(data, "C", 0, 0, 805, 0, 0);
// argument data is given as string and will be converted to the matching attribute of the parameter:
connection.Parameter.ReadData("0", "C", 0, 0, 805, 0, 0);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterWriteData, where you can find further documentation.
HRESULT IParameter::ReadListLength ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] struct ParameterListLength listLength 
)

Reads the information about the length of list parameter. This method does not work for non-list parameters.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]listLengthInformation about the length of list parameter.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// get informations about a list parameter
ParameterListLength listLength = connection.Parameter.ReadListLength("C-0-484", null, null, null, null, null);
// print to console
Console.WriteLine("numActualElements: " + listLength.numActualElements);
Console.WriteLine("numMaximumElements: " + listLength.numMaximumElements);
Console.WriteLine("elementSizeBytes: " + listLength.elementSizeBytes);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadListLength, where you can find further documentation.
HRESULT IParameter::ReadDataAsString ( [in] BSTR  idn,
[in, optional] VARIANT  address,
[in, optional] VARIANT  set,
[in, optional] VARIANT  block,
[in, optional] VARIANT  si,
[in, optional] VARIANT  se,
[out, retval] BSTR *  data 
)

Reads a parameter and always returns its content as string. So this method does the same as ReadData, but ALWAYS returns the data to be read converted to string representation. You can use this function not only for string variables, but also for other types. In this case, the function tries to convert the data to a string representation of the given value. This conversion is based on the information about the attribute of the parameter. This can be useful if you only want to display the variable as string and you don't need to know the type of variable. If you want to read the variable with its original type then you have to use the method ReadData.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressOptional argument for the address instance. Necessary if the address information is not part of the IDN string.
[in]setOptional argument for the set information. Necessary if the set information is not part of the IDN string.
[in]blockOptional argument for the block instance. Necessary if the block information is not part of the IDN string.
[in]siOptional argument for the si instance. Necessary if the si information is not part of the IDN string.
[in]seOptional argument for the se instance. Necessary if the se information is not part of the IDN string.
[out]dataReturn value containing the parameter data requested as string.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// read a non-string parameter from the device
string data = connection.Parameter.ReadDataAsString("C-0-0080", null, null, null, null, null);
// print to console
Console.WriteLine("Data: " + data);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadData, where you can find further documentation.

The documentation for this interface was generated from the following file: