This function returns the configured number of an object based on its logical address i_stLogAdr. This method allows you to determine how many servo amplifiers have been configured.
Data type |
Description |
---|---|
DINT |
-1: An error is detected 0: The object that is searched for is not configured >0: Configured number of the object |
The number of Sercos slaves in the PLC configuration is to be determined.
PROGRAM PLC_PRG
VAR
xStart : BOOL := TRUE;
diNumberOfDrives : DINT;
diNumberOfLXM62DxS : DINT;
diNumberOfILM62 : DINT;
diNumberOfLXM62PS : DINT;
END_VAR
IF xStart THEN
xStart := FALSE;
diNumberOfLXM62DxS := GetActualCountByLogAddr(LXM62DxS_TYPE);
diNumberOfILM62 := GetActualCountByLogAddr(ILM62_TYPE);
diNumberOfLXM62PS := GetActualCountByLogAddr(LXM62PS_TYPE);
diNumberOfDrives := diNumberOfLXM62DxS + diNumberOfILM62;
END_IF