Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check for SRQ and SerialPoll using VisaNS in VB.NET

Hi All

 

I am using VB.NET 2005 and VisaNS

 

I am trying to check for SRQ and do a serial poll.

 

How do I do that any help (with some code) in this regard is appreciated.

 

Thanks in advance

 

Cheers

 

 

0 Kudos
Message 1 of 15
(7,311 Views)

Greetings master9991

 

I did a quick Google search on this issue.

Have you checked the following document?

http://www.ni.com/support/visa/vevents.pdf (around page 😎

And the following example?

http://zone.ni.com/devzone/cda/epd/p/id/3089

 

Let us know if they are of any help to you.

 

Have a good day.

Luis J.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 15
(7,301 Views)

Thank you for the reply Luis J.

 

Option # 1

I am trying to look and understand the c code in page 8 (in vevents.pdf file) and try to convert/get an equivalent vb.net code

http://www.ni.com/support/visa/vevents.pdf (around page 😎

 

Option # 2

The under given example is in LabView and can't read the vi file nor do we use labview.

And the following example?

http://zone.ni.com/devzone/cda/epd/p/id/3089

 

So I am gone try option # 1 and see if it works for me (am sure it would take some time).

 

Thank you once again.

 

0 Kudos
Message 3 of 15
(7,295 Views)

Greetings master9991

 

Oh, I'm sorry, I didn't realize that the last example was for LabVIEW.

 

The syntax change between VB and C, but the structure of the program itself shouldn't be that different.

 

Let us know how it goes. Have a good day.

Luis J.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 15
(7,280 Views)

 

I need to switch off the autopolling.

How to use the setAttribute function (it should correspond to ibconfig according to NI documentation) when there is no Attribute Type related to Autopolling?

 

0 Kudos
Message 5 of 15
(7,114 Views)

Hi wolfgang7753

 

I found a couple of documents that might come in handy for you

 

Serial Polling and SRQ Servicing with NI-488.2 Software and Basic
http://www.ni.com/white-paper/4054/en/

 

"To be active, Autopolling must be enabled and allowed. Whether Autopolling is enabled is determined by the driver configuration program or by the ibconfig function. Note that all NI drivers are shipped with Autopolling enabled by default by the driver configuration program. Autopolling is allowed following the execution of any NI-488 device-level function. Autopolling is disallowed following the execution of any NI-488 board-level function or NI-488.2 routine."

 

How Can One Tell when the Autopolling Feature of National Instruments GPIB Boards Will Function?
http://digital.ni.com/public.nsf/allkb/9C25D443B106B30F862562870079AFE8

 

Cheers!

Fabián M.
Internal Sales Engineer
National Instruments
0 Kudos
Message 6 of 15
(7,103 Views)

Thanks for your answer but unfortunately I know these documents and they dont help in resolving my problem.

 

I need to switch off Autopolling!

 

1. with ibconfig it is possible to set several parameters on the GPIB board (like Timeout, Autopolling, ...)

2. in the visaNS system the command that represents ibconfig is SetAttribute

3. I can't find the AttributeType for Autopolling in the documentation (there are all the other Attribute Types for Timeout, ...)

4. How to switch off Autopolling using only visaNS?

 

Best regards

Wolfgang

 

0 Kudos
Message 7 of 15
(7,083 Views)

Hi wolfgang7753,

 

The only way I could locate to disable Autopolling would be through NI-MAX which is a free to download utility that should have been installed when you installed NI-VISA.

 

Below in figure 6 you can see that Autopolling is a setting: http://www.ni.com/gettingstarted/setuphardware/instrumentcontrol/gpibenet.htm

Please note that this option will be grayed out if you are on Windows 7. In order to change these settings, you will need to run Measurement and Automation Explorer as an administrator.

 

Let us know if this helps.

 

 

MJ
Application Engineer
National Instruments
0 Kudos
Message 8 of 15
(7,069 Views)

Thanks, the answer does not help.

I was asking how to disable Autopolling by my software. The manual solution is insufficient as everytime I connect an other GPIB card on the bus I have to remember to go into the settings... 

 

Is there anybody from NI who knows the solution?

 

Best Regards

Wolfgang

0 Kudos
Message 9 of 15
(7,063 Views)

With a little more research, I found this below article that mentions how to turn off Autopolling by making a NI-488.2 call just before your application exits.

 

http://digital.ni.com/public.nsf/allkb/627380484246D46E862573B4008332D2

 

I think this is the solution you are looking for.

MJ
Application Engineer
National Instruments
0 Kudos
Message 10 of 15
(7,052 Views)