SNMP_SET (FB)¶
FUNCTION_BLOCK SNMP_SET
Function block to send SNMP SET request to an agent.
- 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)
snmpVarBindingsREFERENCE TO ARRAY [0..(gc_uiMaxSNMPValues - 1)] OF SNMPVarBinding
Variable bindings (OID/Value) to send
iNumberOfVarBindingsINTNumber of variable bindings.
uiPeerPortUINT161
Port of the sender (the control)
uiSendPortUINT161
Port of the agent (printer, router etc.)
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
sUserNameSTRING‚‘
SNMP V3 only: Name of the registered user. Use the function CreateUser to register an user.
sContextNameSTRING‚‘
SNMP V3 only: Context name
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 set 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: