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
xExecuteBOOLStarts the request
sHostSTRING(100)Hostname or IP address of the SNMP agent
sOwnIPSTRING(100)Hostname or IP address of the SNMP master (the IP of the control)
asOIDsREFERENCE TO ARRAY [0..(gc_uiMaxOIDs - 1)] OF STRING((gc_iMaxValueLength - 1))
Array of OIDs to request
iNumberOfOIDsINTNumber of OIDs in asOIDs
uiPeerPortUINT161
Port of the sender (the control)
uiSendPortUINT161
Port of the agent (printer, router etc.)
eRequestTypeType of the request
sCommunitySTRING‚public‘
The community, default: ‚public‘
xClosePeerBOOLRising edge closes the UDP peer.
uiTimeoutUINT1000
Timeout in milliseconds, default: 1000 ms
bySNMPVersionSNMPVersion.V1
SNMP Version, default: V1
sUserNameSTRINGSNMP V3 only: Name of the registered user. Use the function CreateUser to register an user.
sContextNameSTRING‚‘
SNMP V3 only: Context name of the request.
xRequestReportBOOLTRUE
SNMP V3 only: TRUE: Requests a report to discover the engineId of the agent, Default: TRUE
Output
xBusyBOOLTrue while busy
xDoneBOOLTrue if the call has finished
xErrorBOOLTrue if an error occured
aSNMPValuesARRAY [0..gc_uiMaxSNMPValues] OF SNMPValue
The result of the get request
iSizeINTSize of aSNMPValues
eErrorError state of the function block
diErrorStatusDINTSNMP error status of the last request
diErrorIndexDINTSNMP error index of the last request (index of the object that caused the error)
diRequestIdDINTSNMP request id of the last request
abResponseARRAY [0..(gc_uiMaxTelegramLength - 1)] OF BYTE
msgAuthoritativeEngineIDSNMP 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:
Structure: