Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Instrument Getting Hung on multiple queries from PC using HISLIP .net

Solved!
Go to solution

Need help understand the issue.

 

We are facing strange problem of instrument getting hung up after few days of operation.

 

I have implemented NI VISA using HISLIP to an instrument where one thread is continuously querying the status and parameters of the instrument in C#.

 

Another thread is running which sets one or two parameters every few minutes and exits.

 

I have implemented all threads to open session and keep it alive i.e. session opened is not closed and kept open. (I tried opening and closing session also but the same issue persist)

 

I understand multiple client can connect to instrument using HISLIP but I think this may be a problem.

 

Can anyone please help. Let me know if you need anything from my side.

0 Kudos
Message 1 of 5
(2,315 Views)

Need to make sure that if thread A sends (Visa Write) a query command then thread B doesn't send a query command before thread A did a read for the response to its query. Visa has lock and unlock to prevent this or you could use C# locks if you want

0 Kudos
Message 2 of 5
(2,262 Views)

Thanks for your response. 

 

I am sure that it is not the case NI IO Trace does not show any overlapping as well.

 

0 Kudos
Message 3 of 5
(2,247 Views)

I have implemented all threads to open session and keep it alive i.e. session opened is not closed and kept open. (I tried opening and closing session also but the same issue persist)

 

I understand multiple client can connect to instrument using HISLIP but I think this may be a problem.

 


I usually use a common session, even when Visa functions are called from from different threads (in principle Visa functions are thread-safe). Then as I understand all calls are bound to the same client. I don't know if this matters but anyway it's not difficult to try.  

0 Kudos
Message 4 of 5
(2,200 Views)
Solution
Accepted by topic author DATDVLP

Precisely, I did try this and resolved the issue. However, I did change from .net drivers provided and NI VISA provided by Manufacturer to raw visa also. this did work for me.

0 Kudos
Message 5 of 5
(2,194 Views)