LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SNMP implementation

Yes, that is what I am saying. Th elibrary has all the necessary calls for you, including the actual UDP Open and Close. Your open is not configured correctly or using the right ports. Port 0 doesn't work. The SNMP Walk VI is a good example of how to use these VIs.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 11 of 53
(2,042 Views)

could you tell me if there is a specific MIB compiler that I should use for your VIs? or it should work with any free SNMP MIB compiler that I find on the internet?

After compiling the MIB I assume I will get a new document, and that's the one I have to import to labview, am I right?

 

Thank you very much, I really appreciate your help

0 Kudos
Message 12 of 53
(2,027 Views)

My VIs do not work with any MIB compliler. The require the specific OIDs to be passed to them. You would use the MIB complier (any one) to generate the list of OIDs and what element they refer to. My get VIs take an array of OIDs as input. The OIDs are simply strings in the format of 1.3.6.1.2.1.1.1 (MIB 1213 "sysDescr"). The set VIs require a 2-D array which consist of the OID, the type (expressed as a string using the standard SNMP MIB type names) and the value. This 2D array is string values so numeric data needs to be converted to a string.

 

Do you have the MIB that you want to use? What specific data do you want to get/set? If you could post those I could give you a hand putting together a basic call.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 13 of 53
(2,020 Views)

Hi, I don't have the actual MIB from the manufacturer (Peek Traffic) although according to the NTCIP rule that its controller is supposed to follow, I made a .txt with some of the objects definitions that I need. In the very begining I would like to get (and later set) the values of the objects called:

phaseMinimumGreen

phasePedestrianClear

phaseYellowChange

phaseRedClear and phaseRedRevert

 

Thank you very much for your help

0 Kudos
Message 14 of 53
(2,001 Views)

You don't have enough information to determine the complete OID for the items you want to use.

 

I can say that the following are the incompete OIDs for what you want:

phaseMinimumGreen: 1.3.6.1.4.1.<unknown>.1.1.2.1.4.<phaseNumber>

(This equates to:iso.org.dod.internet.private.enterprises.<unknown devices>.asc.phase.phaseTable.phaseEntry.phaseMinimumGreen.<phaseNumber>)

 

phasePedestrianClear: 1.3.6.1.4.1.<unknown devices>.1.1.2.1.3.<phaseNumber>

phaseYellowChange:1.3.6.1.4.1.<unknown devices>.1.1.2.1.8.<phaseNumber>

phaseRedClear: 1.3.6.1.4.1.<unknown devices>.1.1.2.1.9.<phaseNumber>

phaseRedRevert: 1.3.6.1.4.1.<unknown devices>.1.1.2.1.10.<phaseNumber>

 

Devices is defined in the imported MIB TMIB.

 

I would suggest that you run a MIB Walk n your device and start at OID 1.

 

This should get a list of all of the OIDs the device has and will allow you to fill in the missing pieces above.

 

When you have the complete OID the rest is easy. To get the elements above you would pass a 1D array to the "Get snmp item(s).vi" The 1D array will contain the list of your desired OIDs.

 

To set the values you would call "Set snmp Item(s).vi" with a 2d array input. The array columns are OID, Type, Value.

 

The types are INTEGER, UNSIGNEDINTEGER, OCTETSTRING, BINARYSTRING, NULL, OBJECTIDENTIFIER, OBJECTID, IPADDRESS, COUNTER, GAUGE, TIMETICKS and OPAQUE. These types correspond to the definition in the MIB file. ENUMs are specified as INTEGER. BINARYSTRING is a special case of OCTETSTRING in that you can pass an ASCII string of hex values and they will be converted to their binary equivilant. OBJECTIDENTIFER and OBJECTID are the same and are simply an alias. All of your values above are of type INTEGER as defined in the MIB with a range of 0 to 255 except for phaseNumber which is from 1 to 255.

 

I have attached a new copy of the library because there was a bug with UNSIGNEDINTEGERS that I fixed and I don't know if it was updated on LAVA. I also attached two simple VIs which would do a basic GET and a SET.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 15 of 53
(1,998 Views)

I tried to run your SNMP Walk vi , I put my laptop over the same IP network that the controller is using but I got this error message : error out 56 UDP Read in SNMP Get Response.vi->SNMP MIB Walk.vi, what should I do about it? I didn't get any data from it even though I tried changing the community name

0 Kudos
Message 16 of 53
(1,996 Views)

Is the community name correct? Make sure you have the community correct. If it is not you will not get a response from the device, which is effectively what the timeout error is saying. You can also try starting the walk at 1.3.6.1.4.1. Do you know if your network is blocking SNMP traffic?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 17 of 53
(1,991 Views)

The network shouldn't be a problem since it is a simple conection between mi laptop PC and the controller, which I put in the same IP address, they just differ in the lowest octect by 1. I don't know if the problem could be the Norton Internet Security software that my laptop has but I haven't found yet if it blocks SNMP messages

0 Kudos
Message 18 of 53
(1,985 Views)

Are you sure you have the correct community name? Is there a way if you can tell if the device is even getting the message? Can you communicate with the device in any other means over the network? Is the device using SNMPv1? If it is using SNMPv3 for security purposes these VIs will not work. They support SNMPv1 only. They will generally work with SNMPv2 devices except you cannot use the GET-BULK PDU.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 19 of 53
(1,980 Views)

I can tell that there's communication between my laptop and the device(controller) since I ping and get a response

0 Kudos
Message 20 of 53
(1,978 Views)