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

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

sCommunity

STRING

‚‘

The community name for this agent (only relevant for SNMP versions other than V3). The community name of incoming requests will be checked against the value. If the community name of an incoming request is not equal to the value of sCommunity, then the request will be discarded. If the value is ‚‘ then community name of incoming requests will NOT be checked. Default: ‚‘

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