10 - 12 - 2019

SNMP

Block SNMPcontroller:

License: Hobby, Industrial

The block can be used to control an Internet/Ethernet module (IP controller) via SNMP protocol.

 

 

  • Digital I/O

The device has two registers with 8 digital I/O each. The names of registers are P3, P5. Every pin of this registers can be set as input or output.

  • Analog inputs

The device has a register P6 with 8 pins, all of them are 10 bit ADC analog inputs in range 0..3.3V. Every IO of all registers are editable via GPIO interface, please read GPIO Strategy:

https://scada.altonalab.com/index.php/en/conceptions/inputs-outputs

When the diagram is started, AltonaLab will send all needful commands to determine the IO as inputs or outputs. Then the process will be started. This will cost a few seconds.

Block's Parameters:

  • CommunicatePerSec - the seconds per which the commands for Read/Write operations will be send to the device. If this parameter is 0, the commands will be send many times per sec.
  • IP Address - The IP address of the device;
  • SNMP R/O Pass - password for R/O operations;
  • SNMP R/W Pass - password for R/W operations;
  • InOut  – the parameter opens a GPIO interface to manage the IO type (digital/analog) and the IO direction (input/output). More for GPIO interface can be read here: https://scada.altonalab.com/index.php/en/conceptions/inputs-outputs
  • SetIODirection - when the diagram starts, the application sends a command to the SNMP device to set the needful directions of every I/O pin. With this parameter we can disable sending of this command to the device;
  • Disable - if the parameter is checked, the device will not work at run time of the diagram;
  • AnalogInpToVolts - if the parameter is checked, the measured values of Analog inputs will be converted to volts in range 0..3.3V. In other case the values will be in range 0..1023.

 

Block's outputs:

  • OnRead - becomes to a high level, when a new data is received from a SNMP device and GPIO outputs are updated;
  • CommunicationError - becomes to a high level if the device does not respond to the send command;

 

Device settings:

For a newly purchased device, some settings need to be made. An interface is available for this purpose, available from the top Settings TAB of the application, then press the button SNMP Devices. The interface has two modes - Simple and Extended, which can be changed from the Combobox - TypeSettings:

Simple interface for SNMP Settings:

The Simple interface allows easy change of the IP address of the device, just enter its current IP address and its passwords, then enter a new IP address and press the button Set.

 

Extended interface for SNMP Settings:

With the Extended interface, a lot of settings can be made, they are grouped into the next groups:

  • Static settings - to set a new IP address, Mask and GateWay of the device;
  • Passwords - allows to change the R/W and Read only passwords of the device;
  • MAC access - we can set one or more MAC addresses, only the devices at a LAN with described MAC addresses can access the SNMP device. If we want to remove this settings, we have to enter 000000000000 as MAC address and to press the button Set.
  • IP, Mask access - if this two settings are made, only the devices with described IP address and Mask can access the SNMP device;
  • Other - there are a lot of additional settings for the SNMP device;

 

Port forwarding:

If the SNMP device is behind an internet router, we can access it from external network but we have to redirect its SNMP port. For this purpose we have to know that its Port is 161.

 

Default settings of the SNMP device are: IP address - 172.16.100.2, Password for Read/Write commands: private, Password for read only commands: 000000000000.

 

Reset to Default:

On center of the device board is a jumper "Reset to Default". If the jumper is set and power up the device, then the device will be reset and default settings will be loaded. A few seconds after power up, the jumper have to be removed.

 

How to connect a PC to new purchased SNMP device:

A new device or a device after Reset to default, has to be connected directly to the computer via LAN cable (not through router). Then IP and mask of the computerLAN network connection have to be set to: 172.16.100.1, 255.255.255.0.

 

 

Block SNMPChecker

License: Industrial

The block is a SNMP client that connects to a SNMP server and checks for new events described by unical ObjectID. The block sends read only commands to the server.

 

Block's parameters:

  • IP Address - IP address of a SNMP Server;
  • SNMP R/O Pass - password for all read only commands to SNMP Server;
  • CommandPerMillisec - if the input Check is connected, the SNMP read command will be send if the input becomes to high level, if it is not connected, the SNMP command will be send per every CommandPerMillisec milliseconds;
  • Disable - is the parameter is checked, the block will not work;
  • Traps - describes all the expected SNMP events. Every Trap is checked by ObjectID, String or Integer value or both - String AND Integer values. The settings of the Traps are shown below:

Trap settings:

  • Name - name of the Trap. Every Trap will appear as a group of three new outputs of the block. The Name of the Trap is used to format names of the block's outputs;
  • Description - description of the Trap;
  • ObjectID - the ObjectID of expected SNMP event generated at SNMP Server;
  • ON String Value - expected text of the SNMP Event;
  • Check by string - if is checked, the received SNMP event will be checked by ON String Value;
  • ON Int Value - expected integer value of the SNMP Event;
  • Check by int - if is checked, the received Event will be checked by ON Int Value;

Every added Trap appears as three block's outputs, the names of the outputs are formed with name of the Trap with added text: _Str, _Int, _Out. For example, if the Trap has name Test1, the outputs will be Test1_Str with String data type, Test1_Int with Integer data type, Test1_Out with Digital data type. If the received SNMP Event has the same ObjectID and On String Value or On Int Value are equal to associated with received SNMP Event text and integer values, the digital output of the block Test1_Out will become to high value. The outputs Test1_Str and Test1_Int will be set with received Text and Integer values associated with received SNMP Event. The output Test1_Out will be cleared if the received SNMP event is with same ObjectID, but received associated text and integer values are not equal to On String Value or On Int Value;

 

Block SNMPTrapReceiver

License: Industrial

With this block, we can process the SNMP messages received from the computer. For this purpose, the SNMP Trap service of the operating system has to be started:

 

Block's parameters:

  • Host - IP Address of the computer which sends the Trap;
  • Community - The SNMP Read-Only Community String is like a user id or password that is sent along with each SNMP Get-Request and allows (or denies) access to a router's or other device's statistics;
  • Port - SNMP Port of the SNMP Service;
  • OutputTimeOutSec - when the digital output associated with received SNMP Event becomes to high level, it will be at a high level until the time specified in this parameter expires;
  • SetOutputToInfinity - when the digital output associated with received SNMP Event becomes to high level, it will be not cleared because of TimeOut;
  • Disable - is the parameter is checked, the block will not work;
  • WriteLOG - if the parameter is checked, the received attributes of the SNMP Event will be saved to the LOG file at folder c:\AltonaLab\LogFiles;
  • Traps - describes all the expected SNMP events. Every Trap is checked by ObjectID, String or Integer value or both - String AND Integer values. The settings of the Traps are shown below:

Trap settings:

  • Name - name of the Trap. Every Trap will appear as a group of three new outputs of the block. The Name of the Trap is used to format names of the block's inputs/outputs;
  • Description - description of the Trap;
  • ObjectID - the ObjectID of expected SNMP event;
  • ON String Value - expected text of the SNMP Event;
  • Check by string - if is checked, the received SNMP event will be checked by ON String Value;
  • ON Int Value - expected integer value of the SNMP Event;
  • Check by int - if is checked, the received Event will be checked by ON Int Value;

Every added Trap appears as three block's outputs and one digital block's input, the names of the outputs are formed with name of the Trap with added text: _Str, _Int, _Out. The name of digital block's input is formed with added text _Clear. For example, if the Trap has name Test1, the outputs will be Test1_Str with String data type, Test1_Int with Integer data type, Test1_Out with Digital data type, the input will be Test1_Clear. If the received SNMP Event has the same ObjectID and On String Value or On Int Value are equal to associated with received SNMP Event text and integer values, the digital output of the block Test1_Out will become to high value. The outputs Test1_Str and Test1_Int will be set with received Text and Integer values associated with received SNMP Event. The output Test1_Out will be cleared if the input Test1_Clear becomes to high level;

Block's inputs:

  • Enable - if the input is connected and it is in low level, the block will not work;

Block's Outputs:

  • OnRead - becomes at high level if a new SNMP Event described at Traps parameter is received;
  • ReceivedHostIP - IP Address of the SNMP sender;
  • ReceivedOID - text of received ObjectID;
  • ReceivedStrVal - associated text of received SNMP Event;
  • ReceivedIntVal - integer value of received SNMP Event;
  • ReceivedSyntax - Syntax of received SNMP Event;
  • ReceivedOctets - Octets of received SNMP Event;
  • ReceivedTime - when the SNMP Event is received;
  • Error - text in case something is wrong;
Important settings - for properly block's work, it is important to do the next:
- Start the Window Trap Service;
- Set the parameter Host with address of the computer, which sends Traps;
- Set the parameter Community with value public;