LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

snmp commands dont work once the thread starts

I am using multi-threading. Once my thread starts executing (using the CmtScheduleThreadPoolFunction), I am not able to run simple get and set snmp function, basically they never return. Any suggestions?
 
Thank you all in advance.
0 Kudos
Message 1 of 9
(4,199 Views)
To add few more details to my question. I am also running multiple threads and for each thread I am using CmtWaitForThreadPoolFunctionCompletion funtion for it to finish. So I am just think if my problem is that my program starts executing other threads while the call to snmp function is made. I dont know how accurate my assumption is. If this is the case I would need to block other threads from executing while my snmp function is executing. Does anyone have an idea as to how to do this?
0 Kudos
Message 2 of 9
(4,190 Views)
Hi qsa301,

Does your function call work without multithreading?
Is the function documented to be able to be called by multiple threads?

Here are some KnowledgeBases about CVI and multithreading:

Executing LabWindows/CVI Internet Library Functions from Multiple Threads
http://digital.ni.com/public.nsf/websearch/88AC3C540ACFE65186257021005D2084?OpenDocument

Multithreading in LabWindows/CVI
http://zone.ni.com/devzone/cda/tut/p/id/3663

General Information on Multithreading for C Programmers
http://digital.ni.com/public.nsf/websearch/6ECCBAA87476EB22862568950071CCD6?OpenDocument

Sending Parameters to a Thread Callback Function in LabWindows/CVI
http://digital.ni.com/public.nsf/websearch/A50A89929B77EE06862571BF0015F42F?OpenDocument

LabWindows/CVI and Thread Pools
http://digital.ni.com/public.nsf/websearch/F968F9F8B100393786256D25005EAF8A?OpenDocument


Gavin Fox
Systems Software
National Instruments
0 Kudos
Message 3 of 9
(4,163 Views)

I am having the same problems.

 

I have one thread running so the calls the snmp functions only come from within the single thread.

 

The code runs fine using a simple do while loop but using either threads or asynchronous timers

the snmp call SNMP_Get locks the program.

 

Any solution to resolve this greatfully appreciated.

 

John

 

 

 

 

 

0 Kudos
Message 4 of 9
(3,568 Views)

Hi John,

 

It looks like SNMP doesn't support multi-threading.  Check out this link

Regards,

Hassan Atassi
Senior Group Manager, Digital Support
0 Kudos
Message 5 of 9
(3,552 Views)

qsa301, I hope you are still around 2.5 years since your last post.

 

If you did the SNMP programming in C, can you share some code?

0 Kudos
Message 6 of 9
(3,436 Views)

Try looking at Net-SNMP. They have some example code in their tutorials section.

Regards,

Anjelica W.
National Instruments
Product Marketing Manager
FlexLogger and TestStand
0 Kudos
Message 7 of 9
(3,419 Views)

Angelica,

 

I spend the better part of a week trying to get some simple thing in Net-SNMP to compile in the CVI environment.  Dismal failure.  That's why I'm trying to find somebody who has done it before, so I can see some sample code.

0 Kudos
Message 8 of 9
(3,408 Views)

I'm sorry that you have been unable to develop your application in CVI. Unfortunately, CVI does not contain any SNMP libraries, but it is my understanding that this is possible through the Windows SDK. However, I am not very familiar this protocol and NI does not have any examples for CVI. I would recommend reposting your question in a new thread. This will ensure that your post receives an increased amount of exposure.

Regards,

Anjelica W.
National Instruments
Product Marketing Manager
FlexLogger and TestStand
0 Kudos
Message 9 of 9
(3,389 Views)