IOL_IdentificationAndDiagnosis (FB)

FUNCTION_BLOCK IOL_IdentificationAndDiagnosis

The Function Block reads or writes identification or diagnosis data from the Device.
For being able to use the full feature set, all Device parameters specified by CommonApplicationProfile Identification and Diagnosis (0x4000) (which supports the FunctionClasses DeviceIdentification (0x8000), Device Diagnosis (0x8003), and ExtendedIdentification (0x8100)) are required.

Example

PROGRAM GetIOLinkInfo
VAR
    cnct : CommFB.CNCT;
    iolInfo : ProfinetCommon.IOL_IdentificationAndDiagnosis;
END_VAR


// here we first open a supervisor AR.
// (Only necessary if PROFINET Device is not in data exchange with controller).
cnct.D_ADDR.SYSTEM := CommFB.IO_SYSTEM_TYPE.PROFINET_IO;
cnct.D_ADDR.PN.MASTER := PN_Controller.MasterID;      // there could be more than one Controller in the project !
cnct.D_ADDR.PN.D.STATIONNAME := 'iolink-master';      // stationname of the online device
cnct.D_ADDR.PN.D.VENDOR := 16#0136;            // usually you get get this data from GSDML or DCP_Identify / Scan (see ProfinetCommon.DCP_Identify FB)
cnct.D_ADDR.PN.D.DEVICE := 16#AC6F;
cnct.D_ADDR.PN.D.INSTANCE := 1;                // typically 0 or 1

cnct.D_ADDR.PN.API := 16#4E01;            // IO-Link API
cnct.D_ADDR.PN.SLOT := 1;
cnct.D_ADDR.PN.SUBSLOT := 1;          // IOLM is in subslot 1

cnct();                   // start with cnct.REQ := TRUE
IF(cnct.VALID) THEN
    iolInfo(xExecute := TRUE, ID := cnct.ID, Port := 6);     //start request for IO-Link device data
END_IF

iolInfo();
InOut:

Scope

Name

Type

Initial

Comment

Input

xExecute

BOOL

A trigger causes the function selected with variable Function to be executed

ID

DWORD

Addresses the IO-Link proxy Submodule i.e. IO-Link Master or IO-Link Device

Port

BYTE

Port number

Func

IOL_IdentificationAndDiagnosis_Function

IOL_IdentificationAndDiagnosis_Function.rd_all

This variable selects the functionality to be triggered by a Request

BackupEnable

BOOL

This variable configures the behavior of the FB in case of the requested function wr_ident.

ApplicationSpecificTagIn

STRING(32)

serves as a free user specific tag

LocationTagIn

STRING(32)

extended identification parameter which can be used for overall localisation and identification of any Device (requires FunctionClass ExtendedIdentification).

FunctionTagIn

STRING(32)

extended identification parameter which can be used for overall localisation and identification of any Device (requires FunctionClass ExtendedIdentification).

Output

xDone

BOOL

The signal is set, if the FB has completed a requested operation.

xBusy

BOOL

The signal is set, if the FB is executing a requested operation.

xError

BOOL

The signal is set, if an error occurred during execution of a re-quested operation.

STATUS

UDINT

The value represents the current status of the FB operation and ex-ecuted functions. The content is system specific and contains the status information

ProfileIDList

ARRAY [0..(IOL_Constants.MaxNumProfileID - 1)] OF IOL_ProfileIdentifier

List of ProfileIDs supported by the Device

FunctionClassIDList

ARRAY [0..(IOL_Constants.MaxNumProfileID - 1)] OF IOL_ProfileIdentifier

List of FunctionClassIDs supported by the Device

IdentificationObjects

IOL_IdentificationObjects

Structured list of identification objects

DeviceOK

BOOL

The signal is set when no further diagnosis info is available, it is false when further information is available at DeviceStatus and DetailedDeviceStatus

DeviceStatus

BYTE

See Device parameter in clause B.2.18 in [1]

DetailedDeviceStatus

ARRAY [0..(IOL_Constants.MaxNumDetailedDeviceStatus - 1)] OF DWORD

This parameter contains the type casted values from the Device parameter defined in clause B.2.19 in [1]