L_MC1P_IndexToParameter2 (function)

This function converts a CANopen index into a parameter number.

 

 

 

L_MC1P_IndexToParameter2

 

 

 

UINT

-

uiIndex

L_MC1P_IndexToParameter2

-

DINT

USINT

-

usiSubindex

UINT

-

uiByteLength

BOOL

-

xUnsigned

 

 

 

 

 

 

 

 

Parameter

Name

Data type

Information/possible settings

uiIndex

UINT

CANopen index

The index and subindex can be specified as decimals (e.g. uiIndex := 16#2900;) or hexadecimals (e.g. uiIndex := 16#2900;). (Example i700 index 0x2900, speed controller: reset time)

usiSubindex

USINT

CANopen subindex

uiByteLength

UINT

Number of the bytes to be written

xUnsigned

BOOL

TRUE

Parameter value is unsigned

FALSE

Parameter value is signed

Return value

Name

Data type

Meaning

L_MC1P_
IndexToParameter2

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_IndexToParameter2(uiIndex:=INT_TO_UINT(16#2900),
usiSubindex:=INT_TO_USINT(2),
uiByteLength:= INT_TO_UINT(2),
xUnsigned:=True);

For parameters with the "Signed" data type, the xUnsigned parameter can be set to False or L_MC1P_IndexToParameter (function) can be used.