Type: |
Function block |
Available as of: |
V1.0.0.0 |
The FB_SnmpManager function block is used to perform SNMP requests to managed devices on IP (Internet Protocol) networks.
The FB_SnmpManager function block is the user interface for SNMP communications.
Only one request to one agent can be managed at a time.
The function block needs to be enabled and ready to perform a request. When starting the execution of a request, the inputs i_etRequest and iq_stRequestInfo need to be set. The information from the inputs is used to build a SNMP telegram containing the request, and then to send it via UDP to the agent. The function block waits for a response from the agent, processes it and presents the received information at iq_stRequestInfo.stResponse. As long as the function block is executing a request, the output q_xBusy is set to TRUE and q_etResult shows the state of operation. The output q_xDone signals a successful execution and q_xError shows if the function block detects an error during execution with q_etResult and q_sResultMsg presenting further information on the nature or cause of the detected error. If an error is detected, the function block needs to be reset by disabling and re-enabling it.
Input |
Data type |
Description |
---|---|---|
i_xEnable |
BOOL |
Activation and initialization of the function block. |
i_xExecute |
BOOL |
The command specified with the input i_etRequest is executed upon rising edge of this input. |
i_etRequest |
ET_SnmpRequest |
The SNMP request that is executed if the input i_xExecute is TRUE. Make sure that iq_stRequestInfo is available before the SNMP request is executed. |
i_etVersion |
ET_SnmpProtocolVersion |
Specifies protocol version for communication with the agent. Default value is ET_SnmpProtocolVersion.Version2c. |
Input / Output |
Data type |
Description |
---|---|---|
iq_stRequestInfo |
Used to pass the structure containing information for sending a request to an agent and the structure to present the received response from the agent. |
Output |
Data type |
Description |
---|---|---|
q_xActive |
BOOL |
If the function block is active, this output is set to TRUE. |
q_xReady |
BOOL |
If the initialization is successful, this output signals a TRUE as long as the function block is capable of accepting inputs. |
q_xBusy |
BOOL |
If this output is set to TRUE, the function block is executing the command specified at the input i_etRequest. |
q_xDone |
BOOL |
If this output is set to TRUE, the function block has successfully completed the command specified at the input i_etRequest. Additional data is provided at iq_stRequestInfo.q_stResponse. |
q_xError |
BOOL |
If this output is set to TRUE, an error has been detected. For details, refer to q_etResult and q_etResultMsg. |
q_etResult |
ET_Result |
Provides diagnostic and status information. |
q_sResultMsg |
STRING[255] |
Provides additional diagnostic and status information. |