L_MC1P_IndexToParameter (function)

This function converts a CANopen index into a parameter number.

 

 

 

L_MC1P_IndexToParameter

 

 

 

UINT

-

uiIndex

L_MC1P_IndexToParameter

-

DINT

USINT

-

usiSubindex

UINT

-

uiByteLength

 

 

 

 

 

 

 

 

Parameter

Name

Data type

Information/possible settings

uiIndex

UINT

CANopen index

The index and subindex can be specified as decimals (e.g. uiIndex := 10624;) or hexadecimals (e.g. uiIndex := 16#2980;). (Example i700 index 0x2980, position controller gain)

usiSubindex

USINT

CANopen subindex

uiByteLength

UINT

Number of the bytes to be written

Return value

Name

Data type

Meaning

L_MC1P_IndexToParameter

DINT

Parameter number (the value is generally a negative number)

Example

This example illustrates the conversion of the Speed controller: Reset time parameter (index = 0x2900, subindex = 2) to a parameter number. The byte length can be determined from the data type of the parameter. In the example: UNSIGNED_16 corresponds to a byte length of two.

// Declare variables
Parameter number: DINT;
//Conversion of the parameter "Speed controller: Reset time" (index=0x2900, subindex=2)  to a parameter number
Parameter number:= L_MC1P_IndexToParameter(uiIndex:=INT_TO_UINT(16#2900),
usiSubindex:=INT_TO_USINT(2),
uiByteLength:= INT_TO_UINT(2));
Note!

If an MC_Read block is used, this function serves to read out the parameter number determined as "Signed" value. In order to read out an "Unsigned" value, the parameter number must be used by L_MC1P_CodenumberToParameter2 (function) .