Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable automatic serial polling

Using VB6 and NI-VISA library, I want to Query a GPIB instrument, and read the response after receiving SRQ on "message available" (MAV). The following code illustrates what I'm doing:


Dim RMDefault As ViSession
Dim Instrument As ViSession
Dim InterfaceCard As ViSession
Dim status As ViStatus
Dim retCount as Integer
Dim buffer as String
Dim SRQState as Integer

buffer = Space$(1024)

status = viOpenDefaultRM(RMDefault)
status = viOpen(RMDefault, "GPIB0::16::INSTR", VI_NULL, VI_NULL, Instrument)
status = viOpen(RMDefault, "GPIB0::INTFC", VI_NULL, VI_NULL, InterfaceCard)

status = viWrite(Instrument, "*sre 16", 7, retCount) ' Generate SRQ on Message Available
status = viWrite(Instrument, "*idn?", 5, retCount)   ' Query instrument

' Wait for SRQ to occur
Do
    status = viGetAttribute(InterfaceCard, VI_ATTR_GPIB_SRQ_STATE, SRQState)
Loop While SRQState <> 1

status = viRead(Instrument, buffer, Len(buffer), retCount) ' Read query response

When I tried to run this, it hung in the do loop, because the SRQ signal was never detected. After a bit of troubleshooting, I discovered that the NI driver was serial polling the bus and killing the SRQ signal before my code could ever detect it. After some searching on this forum, I learned that I need to disable "Automatic Serial Polling" using Measurement and Automation explorer, or using a NI-488.2 call ibconfig(bd, ibcautopoll,0).

OK, ibconfig() works, but it's not part of the VISA library. Is there any way to turn off Auto Polling using a VISA call?

0 Kudos
Message 1 of 2
(4,302 Views)
Hello jhorvath,

Thank you for contacting National Instruments.

From the information you have provided here, you are correct that you are able to disable the Automatic Serial Polling using the NI-488.2 call ibconfig(bd, ibcautopoll,0) or disabling “Automatic Serial Polling” in Measurement & Automation Explorer.

There is not a VISA call that will turn off the polling because the VISA software layer is for more general commands. I referenced the NI-VISA Programming Manual when looking into your question.

I would recommend that you use the NI-488.2 call or the option in Measurement & Automation Explorer.

I hope this helps! Let me know if there is anything else I can help with or clarify. Have a great day!

Sarah S.
Applications Engineering
National Instruments

Message Edited by saras on 10-08-2007 11:40 AM

Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(4,274 Views)