SNMP_TRAP_SENDER (FB)¶
FUNCTION_BLOCK SNMP_TRAP_SENDER
Function block to send SNMP TRAP and INFORM requests.
- 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)
uiPeerPortUINT161
Port of the sender (the control)
uiSendPortUINT161
Port of the agent (printer, router etc.)
sEnterpriseSTRING((gc_iMaxValueLength - 1))The OID which generated this TRAP
snmpVarBindingsREFERENCE TO ARRAY [0..(gc_uiMaxSNMPValues - 1)] OF SNMPVarBinding
Variable bindings (OID/Value) to send
iNumberOfVarBindingsINTNumber of variable bindings.
sCommunitySTRING‚public‘
The community, default: ‚public‘
xClosePeerBOOLRising edge closes the UDP peer.
bGenericTrapTypeBYTE6
Generic trap type, default: 6 (enterprise specific)
bSpecificTrapTypeBYTE0
Specific trap type, default 0
udiTimestampUDINT0
Timestamp, default 0
eTrapTypeTrapType.V1_Trap
Type of the request (default V1_Trap)
uiTimeoutUINT1000
Timeout in milliseconds, default: 1000 ms (only for INFORM messages)
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
msgAuthoritativeEngineIDREFERENCE TO SNMPValue
SNMP V3 only: The authoritative engine Id. If not set, then GVL.g_pEngineId is used. You can discover the engine id via SNMP_GET_REQUEST (see output msgAuthoritativeEngineID) with xRequestReport = TRUE.
Output
xBusyBOOLTrue while busy
xDoneBOOLTrue if the call has finished
xErrorBOOLTrue if an error occured
eErrorError status of the request.
Methods:
Structure: