How do i read an I/O register using SNMP ?

Revision as of 12:34, 12 April 2013 by StefanG (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

I/O registers in the Barionet (1000 instances) either are tied to hardware or just hold values, as an interface to a BCL program in the Barionet. Registers can be polled and also controlled using standard SNMP get/set requests. For set operations, the community "private" needs to be used (default). These same registers can also be accessed using Modbus/TCP or ASCII control protocols (and even via cgi/web server).

You can easily control the relays, for example, by using SNMP set requests on registers 1 and 2.

The detailed register map is documented in the Barionet manual.

How do the registers map to Object ID's ?

This is defined in the Barionet MIB, which is included in the device (you can access it with the URL /barionet.mib on the device), and on the Barix website.

Here is, for example, the OID for register 201 (digital input 1): 1.3.6.1.4.1.17491.1.1.2.1.2.201

In some systems, you may be able to use a name like this:

SNMPv2-SMI::enterprises.17491.1.1.2.1.2.X - X being the register number, for example. 1..4 for the four relays on the Barionet 50

Specifically, for the relays and digital outputs, the following values can be used:

  • 0 (reset the relay), 1 (set the relay),
  • 2..998 .. pulse the relay for the value times 100ms (5 is 500ms, 50 would be 5 seconds)
  • 999 to toggle the relay.

Example to activate relay 3 using snmpset on OSX:

snmpset -v 1 -c private 192.168.1.121 SNMPv2-SMI::enterprises.17491.1.1.2.1.2.3 u 1


Back to FAQ#Control FAQ