zyh7148

help for useing SNMP in labview

36 posts in this topic

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!

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

There are also some quit cheap activeX toolkits available on the net that can be interfaced in LabVIEW.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Hello,

It's OK. Now I can communicate with my system and see all the elements contained in the agent.

Thank you very much for your help...

Share this post


Link to post
Share on other sites

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

Sorry.How can I find your download link?

Share this post


Link to post
Share on other sites

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

Hello,could you tell me how to download your SNMP source cold´╝čI could not find your download link.sad.gif

Share this post


Link to post
Share on other sites

Here it is.

Nice to meet you,sir.I'am a yang man.I'am a FPGA lover.Thank you very much.

Share this post


Link to post
Share on other sites

Nice to meet you,sir.I'am a yang man.I'am a FPGA lover.Thank you very much.

Welcome to LAVA.

Share this post


Link to post
Share on other sites

Here it is.

Good work. A very nice library.

Rolf Kalbermatter

Share this post


Link to post
Share on other sites

Good work. A very nice library.

Rolf Kalbermatter

Thanks. There are a few things that should be fixed. At the moment if any varbind returns an error no data will be returned for the PDU. The library should parse the all varbinds and only discard those marked with errors.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now