Jump to content

help for useing SNMP in labview


Recommended Posts

Hi, hello!

I have one devie which is used for monitoring the water leaking in my project. But the data of this device is only monitored in web browser, which is not compatible with our software frame of labview. The vendor of this device only provides the MIB file of SNMP protocol. If I want to integrate DAQ system of this device in our software frame of labview, are there good ways? Or who sends me the free SNMP Toolkit of labview?

My E-mail is zyh7148@yahoo.com.cn

Thank you!

Link to comment

QUOTE (Mark Yedinak @ Mar 14 2009, 04:25 PM)

Here is a basic SMNPv1 implementation I wrote years back. This code can be improved a bit but for basic communications it works well.

Thank you very much!

Is this software toolkit used for SNMPv3? Are there difference between SNMPv1 and SNMPv3? Please send me some example of this software tookit.

Thanks!

Link to comment

QUOTE (zyh7148 @ Mar 17 2009, 03:52 AM)

Thank you very much!

Is this software toolkit used for SNMPv3? Are there difference between SNMPv1 and SNMPv3? Please send me some example of this software tookit.

Thanks!

There a couple of examples in the library file. This version supports only SNMPv1. With minor modifications it could support SNMPv2 which mainly added the GET-BULK-PDU. As mentioned previously in this thread SNMPv3 adds security to the protocol. Adding support for SNMPv3 would require a little bit more effort. However, if you are only doing simple GET requests, this version should work with your SNMP agent, even if it supports SNMPv3. SNMPv3 agents will still support SNMPv1 messages. From what you described you needed to do this code should work for you.

Link to comment

If you need SNMPv3, and the agent you are talking to has authentication and/or encryption turned on, it will take you some weeks of work to write that code. Using Net-SNMP with System Exec.vi seems like your best free option, though I have not tried this personally. SNMP Toolkit for LabVIEW at snmptoolkit.com costs $995.00 but is a native LabVIEW Toolkit with one .dll for MIB compilation and a second .dll for SNMPv3 encryption and has been used successfully for many v3 projects.

Link to comment

QUOTE (Mark Yedinak @ Mar 17 2009, 02:54 PM)

There a couple of examples in the library file. This version supports only SNMPv1. With minor modifications it could support SNMPv2 which mainly added the GET-BULK-PDU. As mentioned previously in this thread SNMPv3 adds security to the protocol. Adding support for SNMPv3 would require a little bit more effort. However, if you are only doing simple GET requests, this version should work with your SNMP agent, even if it supports SNMPv3. SNMPv3 agents will still support SNMPv1 messages. From what you described you needed to do this code should work for you.

Thanks for your answer, I learn about your software toolkit and I'm going to working on my code soon. If I have other problems about SNMP during my work, I have to need your help.

Thank you very much!

Link to comment
  • 3 weeks later...

Hello,

I would like communicate with a system in SNMPv1. I download the files "snmp communication.zip" in this topic.

My knowleadges in the SNMP communication are very limited and I don't know how I can establish a communication with the system.

I attached the MIB of my system.

Someone could explain me how can I communicate with my system ?

Could you give me an example ?

Thanks for your answers.

Link to comment

QUOTE (Lorenzo @ Apr 3 2009, 03:47 AM)

Unfortunately the MIB document that you posted is not syntactically correct. It would not be able to be parsed correctly by any MIB compiler. With that said I can say that the base OID for your MIB objects will be 1.3.6.1.4.1.9999.x. I should also note that unless you are with the company Zerna, Koepper & Partner (Egbert Casper, cas&zkp.de) you should not be using an enterprise number of 9999. Enterprise numbers are registered with the IANA (Internet Assigned Numbers Authority). You can request an enterprise number http://pen.iana.org/pen/PenApplication.page' rel='nofollow' target="_blank">here. Registering a number is free. If you are on an isolated network you will not encounter any problems but it is always best to play by the rules. Anyway, manually compiling your MIB document is not very easy and it appears that some of your definitions are incomplete. Therefore I cannot give you specific OID values for items in your MIB. From what I can see I assume they want the OID for the dcIdentManufacturer to be 1.3.6.1.4.1.9999.1.1.1.0. dcIdentModel would then be 1.3.6.1.4.1.9999.1.1.2.0 and so on. dcPowerSystemBusbarVoltage is most likely 1.3.6.1.4.1.9999.1.2.1.0.

I would suggest that you look at the MIB Walk (SNMP MIB Walk.vi) example that I included in the library I posted. This will walk the complete MIB of an agent and it will list al avialable OIDs for that the agent. It may not return a value for every element in the mIB since it is legal for a element to be defined but the agent not contain it. Once you see the specific elements supported by the agent you can work with the other VIs in the library to set or get specific elements. The only VIs you will need to use directly from your code are SNMP Get Random Port.vi (it will use the first available local UDP port which minimizes conflicts on your local machine), to open the UDP port and them SNMP Close Port.vi to close it when you are finished. Then you can use Set SNMP Item(s).vi and Get SNMP Item(s).vi to set or get specific OIDs in your agent. You can also use the basic PDU primatives of SNMP Get Next.vi, SNMP Get Request.vi, SNMP Set Request.vi, SNMP Get Response.vi and if required SNMP Get Trap.vi. The remaining VIs in the library should not be called directly.

If you have other questions once you look at this let me know.

Link to comment

QUOTE (Lorenzo @ Apr 3 2009, 03:47 AM)

Unfortunately the MIB document that you posted is not syntactically correct. It would not be able to be parsed correctly by any MIB compiler. With that said I can say that the base OID for your MIB objects will be 1.3.6.1.4.1.9999.x. I should also note that unless you are with the company Zerna, Koepper & Partner (Egbert Casper, cas&zkp.de) you should not be using an enterprise number of 9999. Enterprise numbers are registered with the IANA (Internet Assigned Numbers Authority). You can request an enterprise number here. Registering a number is free. If you are on an isolated network you will not encounter any problems but it is always best to play by the rules. Anyway, manually compiling your MIB document is not very easy and it appears that some of your definitions are incomplete. Therefore I cannot give you specific OID values for items in your MIB. From what I can see I assume they want the OID for the dcIdentManufacturer to be 1.3.6.1.4.1.9999.1.1.1.0. dcIdentModel would then be 1.3.6.1.4.1.9999.1.1.2.0 and so on. dcPowerSystemBusbarVoltage is most likely 1.3.6.1.4.1.9999.1.2.1.0.

I would suggest that you look at the MIB Walk (SNMP MIB Walk.vi) example that I included in the library I posted. This will walk the complete MIB of an agent and it will list al avialable OIDs for that the agent. It may not return a value for every element in the mIB since it is legal for a element to be defined but the agent not contain it. Once you see the specific elements supported by the agent you can work with the other VIs in the library to set or get specific elements. The only VIs you will need to use directly from your code are SNMP

QUOTE (Lorenzo @ Apr 3 2009, 03:47 AM)

Unfortunately the MIB document that you posted is not syntactically correct. It would not be able to be parsed correctly by any MIB compiler. With that said I can say that the base OID for your MIB objects will be 1.3.6.1.4.1.9999.x. I should also note that unless you are with the company Zerna, Koepper & Partner (Egbert Casper, cas&zkp.de) you should not be using an enterprise number of 9999. Enterprise numbers are registered with the IANA (Internet Assigned Numbers Authority). You can request an enterprise number here. Registering a number is free. If you are on an isolated network you will not encounter any problems but it is always best to play by the rules. Anyway, manually compiling your MIB document is not very easy and it appears that some of your definitions are incomplete. Therefore I cannot give you specific OID values for items in your MIB. From what I can see I assume they want the OID for the dcIdentManufacturer to be 1.3.6.1.4.1.9999.1.1.1.0. dcIdentModel would then be 1.3.6.1.4.1.9999.1.1.2.0 and so on. dcPowerSystemBusbarVoltage is most likely 1.3.6.1.4.1.9999.1.2.1.0.

I would suggest that you look at the MIB Walk (SNMP MIB Walk.vi) example that I included in the library I posted. This will walk the complete MIB of an agent and it will list al avialable OIDs for that the agent. It may not return a value for every element in the mIB since it is legal for a element to be defined but the agent not contain it. Once you see the specific elements supported by the agent you can work with the other VIs in the library to set or get specific elements. The only VIs you will need to use directly from your code are SNMP

QUOTE (Lorenzo @ Apr 3 2009, 03:47 AM)

Unfortunately the MIB document that you posted is not syntactically correct. It would not be able to be parsed correctly by any MIB compiler. With that said I can say that the base OID for your MIB objects will be 1.3.6.1.4.1.9999.x. I should also note that unless you are with the company Zerna, Koepper & Partner (Egbert Casper, cas&zkp.de) you should not be using an enterprise number of 9999. Enterprise numbers are registered with the IANA (Internet Assigned Numbers Authority). You can request an enterprise number http://pen.iana.org/pen/PenApplication.page' rel='nofollow' target="_blank">here. Registering a number is free. If you are on an isolated network you will not encounter any problems but it is always best to play by the rules. Anyway, manually compiling your MIB document is not very easy and it appears that some of your definitions are incomplete. Therefore I cannot give you specific OID values for items in your MIB. From what I can see I assume they want the OID for the dcIdentManufacturer to be 1.3.6.1.4.1.9999.1.1.1.0. dcIdentModel would then be 1.3.6.1.4.1.9999.1.1.2.0 and so on. dcPowerSystemBusbarVoltage is most likely 1.3.6.1.4.1.9999.1.2.1.0.

I would suggest that you look at the MIB Walk (SNMP MIB Walk.vi) example that I included in the library I posted. This will walk the complete MIB of an agent and it will list al avialable OIDs for that the agent. It may not return a value for every element in the mIB since it is legal for a element to be defined but the agent not contain it. Once you see the specific elements supported by the agent you can work with the other VIs in the library to set or get specific elements. The only VIs you will need to use directly from your code are SNMP

Link to comment

QUOTE (Lorenzo @ Apr 6 2009, 09:08 AM)

Hello,

Thank you for your answer.

I posted the right MIB of the system.

If I understood, I must enter 1.3.6.1.4.1.1356.1.1 in "START MIB WALK WITH OID (1):" and "END MIB WALK WITH OID:" in the SNMP MIB WALK.VI to see all the dcIdent data available.

Is it true ?

Yes, starting your MIB walk at 1.3.6.1.4.1.1356.1.1 will get you the elements under the dcIndent branch. If you also set the END to the same OID than your MIB walk will only return 1 item. The way a MIB walk works is that you use the SNMP GET-NEXT PDU to request the element immediately folllowing the OID given. If you want to walk all of the elements in the upsman MIB then set your start value to 1.3.6.1.4.1.1356.1 and leave the END unset. If the agent is working correctly you should see all of the elements the agent currently contains. An agent that is working correctly will return a nosuchname error for the GET-NEXT of the last item. The GET-NEXT walks the MIB in lexigraphical order. If you would like to walk only the dcIdent branch then set the start OID to 1.3.6.1.4.1.1356.1.1 and the end OID to 1.3.6.1.4.1.1356.1.2.

Link to comment
  • 4 months later...
  • 2 months later...

Hello!

I try to use these vis but it sends me an error "UDP Write in SNMP Get Request.vi"

I do the following:

1- SNMP Get Random Port.vi

2- SNMP Open Port.vi

3 - SET and GET SNMP vis

Is there a solution?

Thank you!

You should also give more informations as to the error number and text you receive and also a bit more background in terms of LabVIEW version etc. Also post the test VI you have been executing when you get your errors. Your description of what you are doing is rather compressed and not very clear.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.