IConnectionDiagnostics.GetInstancePointer (METH) ¶ METHOD GetInstancePointer : POINTER TO ConnectionDiagnostics Converts the Interface Reference to the Instance Pointer The InstancePointer can be used to access the value of each output variable. Example pConnectionDiagnostics : POINTER TO ConnectionDiagnostics ; pDiagnosticsCounter : POINTER TO DiagnosticsCounter ; udiValue : UDINT ; pConnectionDiagnostics := itfDiagnostics.GetInstancePointer (); pDiagnosticsCounter := pConnectionDiagnostics ^. itfTotalError.GetInstancePointer (); udiValue := pDiagnosticsCounter ^. udiValue InOut: Scope Name Type Return GetInstancePointer POINTER TO ConnectionDiagnostics Output eErrorID ERROR
IDiagnostics.Reset (METH) ¶ METHOD Reset : ERROR This Methodis used to set all diagnostics counters to the initial value InOut: Scope Name Type Return Reset ERROR
IDiagnosticsCounter.GetInstancePointer (METH) ¶ METHOD GetInstancePointer : POINTER TO DiagnosticsCounter Converts the Interface Reference to the Instance Pointer The InstancePointer can be used to access the value of each output variable. Example pDiagnosticsCounter : POINTER TO DiagnosticsCounter ; udiValue : UDINT ; pDiagnosticsCounter := itfDiagnosticsCounter.GetInstancePointer (); udiValue := pDiagnosticsCounter ^. udiValue InOut: Scope Name Type Return GetInstancePointer POINTER TO DiagnosticsCounter Output eErrorID ERROR
SNMP_AGENT (FB) ¶ FUNCTION_BLOCK SNMP_AGENT This function block allows to request and set registered values via SNMP GET, SNMP GET_NEXT and SNMP SET. Use the function blocks SNMP_STRING , SNMP_DINT or SNMP_OBJECT to register OIDs and the corresponding values. SNMP V3 GET and GET_NEXT Set an unique engine id via g_EngineId Create an user with the functions CreateUser (read only) or CreateRWUser (read write, see SNMP SET) SNMP SET Conditions for SET: Works with SNMP V3 only eAccessType of SNMP_STRING, SNMP_DINT or SNMP_OBJECT must be AccessType .ReadWrite The user must be created with the function CreateRWUser InOut: Scope Name Type Initial Comment Input xExecute BOOL Starts the agent sOwnIP STRING(100) Hostname or IP address of the SNMP master (the IP of the control) uiPort UINT 161 Port of SNMP agent Output xBusy BOOL True while busy xDone BOOL True if the call has finished xError BOOL True if an error occured eError ERROR Error state of the last request
SNMP_DINT (FB) ¶ FUNCTION_BLOCK SNMP_DINT EXTENDS SNMP_VALUE Function block to register a DINT. InOut: Scope Name Type Initial Comment Inherited from Input pSnmpAgent POINTER TO SNMP_AGENT SNMP_Agent to register the SNMP_VALUES SNMP_VALUE sOID STRING((gc_iMaxValueLength - 1)) The OID SNMP_VALUE eAccessType AccessType AccessType.ReadOnly ReadOnly (GET, GET_NEXT) or ReadWrite (GET, GET_NEXT and SET) SNMP_VALUE Inout diValue DINT The value
SNMP_OBJECT (FB) ¶ FUNCTION_BLOCK SNMP_OBJECT EXTENDS SNMP_VALUE Function block to register a SNMPValue InOut: Scope Name Type Initial Comment Inherited from Input pSnmpAgent POINTER TO SNMP_AGENT SNMP_Agent to register the SNMP_VALUES SNMP_VALUE sOID STRING((gc_iMaxValueLength - 1)) The OID SNMP_VALUE eAccessType AccessType AccessType.ReadOnly ReadOnly (GET, GET_NEXT) or ReadWrite (GET, GET_NEXT and SET) SNMP_VALUE Inout snmpVal SNMPValue
SNMP_STRING (FB) ¶ FUNCTION_BLOCK SNMP_STRING EXTENDS SNMP_VALUE Function block to register a string. InOut: Scope Name Type Initial Comment Inherited from Input pSnmpAgent POINTER TO SNMP_AGENT SNMP_Agent to register the SNMP_VALUES SNMP_VALUE sOID STRING((gc_iMaxValueLength - 1)) The OID SNMP_VALUE eAccessType AccessType AccessType.ReadOnly ReadOnly (GET, GET_NEXT) or ReadWrite (GET, GET_NEXT and SET) SNMP_VALUE Inout sValue STRING((gc_iMaxValueLength - 1)) The value
GET ¶ SNMP_GET_REQUEST (FunctionBlock) Reset (Method)
SNMP_GET_REQUEST (FB) ¶ FUNCTION_BLOCK SNMP_GET_REQUEST Function block to send a SNMP GET or GET_NEXT request. InOut: Scope Name Type Initial Comment Input xExecute BOOL Starts the request sHost STRING(100) Hostname or IP address of the SNMP agent sOwnIP STRING(100) Hostname or IP address of the SNMP master (the IP of the control) asOIDs REFERENCE TO ARRAY [0..(gc_uiMaxOIDs - 1)] OF STRING((gc_iMaxValueLength - 1)) Array of OIDs to request iNumberOfOIDs INT Number of OIDs in asOIDs uiPeerPort UINT 161 Port of the sender (the control) uiSendPort UINT 161 Port of the agent (printer, router etc.) eRequestType RequestType Type of the request sCommunity STRING ‘public’ The community, default: ‘public’ xClosePeer BOOL Rising edge closes the UDP peer. uiTimeout UINT 1000 Timeout in milliseconds, default: 1000 ms bySNMPVersion SNMPVersion SNMPVersion.V1 SNMP Version, default: V1 sUserName STRING SNMP V3 only: Name of the registered user. Use the function CreateUser to register an user. sContextName STRING ‘’ SNMP V3 only: Context name of the request. xRequestReport BOOL TRUE SNMP V3 only: TRUE: Requests a report to discover the engineId of the agent, Default: TRUE Output xBusy BOOL True while busy xDone BOOL True if the call has finished xError BOOL True if an error occured aSNMPValues ARRAY [0..gc_uiMaxSNMPValues] OF SNMPValue The result of the get request iSize INT Size of aSNMPValues eError ERROR Error state of the function block diErrorStatus DINT SNMP error status of the last request diErrorIndex DINT SNMP error index of the last request (index of the object that caused the error) diRequestId DINT SNMP request id of the last request abResponse ARRAY [0..(gc_uiMaxTelegramLength - 1)] OF BYTE msgAuthoritativeEngineID SNMPValue SNMP V3 only: The authoritative engine Id. If xRequestReport = TRUE then this is the discovered engine id of the agent. If xRequestReport = FALSE then GVL.g_pEngineId is used. Methods: Reset Structure: Reset (Method)
IReaderDiagnostics.GetInstancePointer (METH) ¶ METHOD GetInstancePointer : POINTER TO ReaderDiagnostics Converts the Interface Reference to the Instance Pointer The InstancePointer can be used to access the value of each output variable. Example pReaderDiagnostics : POINTER TO ReaderDiagnostics ; pDiagnosticsCounter : POINTER TO DiagnosticsCounter ; udiValue : UDINT ; pReaderDiagnostics := itfDiagnostics.GetInstancePointer (); pDiagnosticsCounter := pReaderDiagnostics ^. itfTotalError.GetInstancePointer (); udiValue := pDiagnosticsCounter ^. udiValue InOut: Scope Name Type Return GetInstancePointer POINTER TO ReaderDiagnostics Output eErrorID ERROR