LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SNMP and Windows SNMP services

I am controlling a SNMP device using LabVIEW UDP communication, this works fine. When I start the Windows SNMP services running, I can no longer communicate with the device.

Is there a way to control an SNMP device with LabVIEW with the Windows SNMP service (Windows XP) running at the same time?
 
 
Davith
0 Kudos
Message 1 of 9
(6,265 Views)
Hi Davith,
 
Could you give me a little more information please?
Do you get any errors with your code/windows.
Are you opening the windows SNMP software after opening the LV code of vice versa.
 
What version of LV are you using and what vi's have you used?  (Did you buy a toolkit or do the legwork yourself?)
Are you running the client SNMP program on Windows or the Server?
 
Any or all answers to these questions should help me look into it further.  My initial thoughts however are that if the labview program does not release the UDP functionality at any time, it might not be possible to run 2 services at the same time.
 
But I'll look into it.
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 2 of 9
(6,250 Views)

More Info on problem:-

LabVIEW 7.1  Windows XP SP2

I’m trying to control 2 SNMP instruments as part of a test setup. One is an APC power switch, the other a Picture Quality Analyser. I have some LabVIEW SNMP ‘driver’ software written by my customer. This uses LV’s UDP functions for communications.

The PQA (Omnitek) instrument was developed using the windows SNMP API agent functions, so the Windows SNMP services need to be running.

I can control the APC power switch fine until I start the Windows SNMP service running. This seems to take complete control of the SNMP port - port 161, stopping any LV UDP communications with this port. I receive the error message:

 ‘Error 60 occurred at UDP Open in Send_Receive UDP.vi->Simple SNMP Communications.vi’

Whenever I try to do any UDP comms on port 161 from LabVIEW with the service running.

I have tried to find out whether the SNMP toolkit has the same problem. I have not received a response from my emails so far.

Davith


 

 

0 Kudos
Message 3 of 9
(6,248 Views)
Davith,
 
Now I see your problem.  You are trying to compunicate over the same UDP port with both a windows application, and a LabVIEW one.,
Unfortunatelly Windows has master rights over all UDP ports.  So if Windows is using that port is closes off access from any other applications.
(This is similar to many e-mail clients that all use SMTP port 25, if you try using 2 clients they will conflict.)
 
The only way I can see of actually running two applications at the same time is to try and configure the devices (if possible) onto 2 different ports (maybe 161 and 162) this should solve your problem.
 
As the toolkits are not actually supplied by NI I am unable to speculate as to wheather they have the same problem (or if they have managed to find another way around this)
 
I hope this all helps
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 4 of 9
(6,244 Views)

Adam

 

Thanks for your comments.

 

It looks like the only way forward is to develop a manager interface using Windows SNMP API calls.

 

I’ll probably do this by developing a DLL using CVI to interface to the SNMP API. I think its better to use CVI rather than LabVIEW for this. Its easier to interface to the odd data types that Microsoft seems to like using. I will then call this DLL from LV.

 

It is a shame that the SNMP Toolit people do not respond to emails. I suspect their code uses UDP calls, as it looks like it was developed before the Windows SNMP API was available.

 

Davith

0 Kudos
Message 5 of 9
(6,240 Views)
The SNMP LabVIEW toolkit providers have now responded to one of my emails. Basically it seems that both email addresses on their website are out of date.
 
Steve Arendt brought up an interesting point. He says that a SNMP manager does not have to use the SNMP port (161) but can use any port (note Manager NOT Agent).
 
But SNMP traps will have a conflict on port 162, so therefore there is a problem if using traps and Windows SNMP services.
 
So if you only need to use ‘Sets’ and ‘Gets’ etc. the Toolkit should save you lots of time. Unfortunately I do need to use traps, so I will probably have to DIY something.
 
 
Davith
0 Kudos
Message 6 of 9
(6,231 Views)
Dear Davith:
 
Now I am trying to use SNMP toolkit also, as you mentioned before, the toolkit can not be used if we have to use traps? Could you please give me some advise? I do not want to waste time.
 
Thanks!
 
Serene
0 Kudos
Message 7 of 9
(5,977 Views)

Hi Serene,

 

I have not used the toolkit to receive traps. I use a loop with a UDP call monitoring port 162, with a 2s timeout. I then decode any information I receive. I suspect the toolkit does something similar.

 

The  most likely reasons for you not receiving traps on a ‘Windoze’ machine is that the Windows SNMP services are turned on. All SMNP services should be disabled on the machine running the LabVIEW code. The next most likely reason is that the equipment generating the traps has not been set to send traps to the IP address of the LabVIEW machine.

 

Good luck

 

Davith

0 Kudos
Message 8 of 9
(5,963 Views)
Dear Davith,
 
Thanks for your quick response. I am wondering if the Windows SNMP services can work under "shared" mode, as I know, some network software can work together with another similar software simultaniously.
 
Anyway I will try to use the toolkit with MySQL database, and I may ask you to help me again.
 
Thanks a lot!
 
Regards,
 
Serene
0 Kudos
Message 9 of 9
(5,956 Views)