LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Error −1073807303 | Unable to queue the asynchronous operation because there is already an operation in progress.

I am doing some asynch visa reads over the lan and every so often I will get an exception:
−1073807303 | Unable to queue the asynchronous operation because there is already an operation in progress.
 
To clear this error requires me to reboot the machine running the GPIB card as well as the machine I am developing on!
 
This is not really an acceptable solution as the GPIB machine is remote.
 
Is there any way I can clear any pending operations?
 
This problem is quite easily reproduced with C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\Visa\SimpleAsynchronousReadWrite\VB example supplied with VISA.
 
The VISA version is 3.6
 
Best Regards,
Mark
 
 
0 Kudos
Message 1 of 9
(6,020 Views)
Hello Mark,

I found the two KnowledgeBases below that talk about that error.

Error 30559 on a viReadAsync and viWriteAsync using Measurement Studio and NI-VISA
Unable to queue asynchronous operation

The first one is probably more relevant to your case, but you can take a look at both and try the suggestions. Hope this helps. Thanks!

Regards,
Ebele O.
National Instruments
0 Kudos
Message 2 of 9
(6,005 Views)
I have figured out how to replicate the problem.
 
Please note I am using visa://lab/GPIB0::28::INSTR type addressing from another machine on the network.
 
Run the C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\Visa\VisaicNS\VB example.
 
Under public methods, click on BeginRead(Int32 count, AsyncCallback callback, Object state) then click on Invoke, an then execute without changing any values.
 
Thats the end of async reads without doing a reboot of the machine with the GPIB card in it.
 
You can verify by using the Method BeginRead(Int32 count).
 
It is fine until you do the BeginRead(Int32 count, AsyncCallback callback, Object state) then you always get an unclearable state with an error message:
Unable to queue the asynchronous operation because there is already an operation in progress.  VISA error code -1073807303 (0xBFFF0039), ErrorInProgress
 
Is it a bug, or a feature, or supposed to work like that?
 
Best regards,
Mark
 
 
0 Kudos
Message 3 of 9
(5,997 Views)
Hi Mark,

What version of Measurement Studio are you using? If you are using Measurement Studio 6, then you'll need to use NI-VISA 2.6. See the KnowledgeBase here for more information. Thanks!

Regards,


Ebele O.
National Instruments
0 Kudos
Message 4 of 9
(5,987 Views)
Hi,

I just wondered if this thread ever got solved?  I'm having a little trouble with this error myself.  In my application, I have several instances of instruments, each with a seperate visa session.  I have the following:

(Measurement Studio 😎
4 Keithley 6487 Ammeter
4 Agilent N6700B Current Source
8 Thorlabs filter wheels
4 RS-485 temperature controller

What I'm finding is that I consistently get this error when sending a number of commands - almost like collisions.  I am using the SRQ event to asynchronously call the BeginRead function.  This is done approximately every second.  On top of this, I am also sending commands like changing the filter position, setting voltages, setting currents etc.  If I do them do quickly, I get this message.

I am using an object lock around the write commands to try to prevent a command sequence being interrupted.  I also have some custom events firing but the error seems to be spawning from the VISA drivers.

If it helps, for each instrument I am carrying out the following:

- Create session
- Synchronize callbacks
- Subscribe to service request event
- Enable event

After each timer tick:
- Send commands to request a new value (for example)
- SRQ event fires
- Use BeginRead to asynchronously read back data

Any and all suggestions are very welcome!

Thanks,

Chris
0 Kudos
Message 5 of 9
(5,744 Views)

Chris,

Based upon the previous posts, it may have a compatibility issue between his particular versions of Measurement Studio and NI-VISA.  What version of NI-VISA do you have?  Did you read the KnowledgeBase associated with this post (see links below)?  Based upon the previous discussion did any of the suggestions help?  One other item to note, are you closing the VISA session properly?  If not, this could also be the source of the error.

Error 30559 on a viReadAsync and viWriteAsync Using Measurement Studio and NI-VISA
Receiving VISA Error : Unable to queue asynchronous operation

 

A_Ryan
AES
National Instruments
0 Kudos
Message 6 of 9
(5,715 Views)
Hi Ryan,

Thanks for the response.  I did indeed go through the knowledge bases to try to get more information.  I'm currently using the following software versions:

Measurement Studio 8.0.2
NI-VISA 3.2

I'm not sure if I'm closing the session correctly, though - based on the one link.

I hope I can explain this correctly but I when I start the program, this is what happens:

- Initialise all equipment (4 keithley 6487's, 4 Agilent N6700B's and 8 Thorlabs filter wheels).
- Enable SRQ on Keithley
- Subscribe to SRQ event
- Start timer to request a new photocurrent measurement every 1s.

On the front panel of my program I am able to change filter wheel positions, set currents and voltage etc and start data logging.  When I start data logging, I subscribe to a custom event that is fired when a new measurement is taken from the picoammeter.  There is no problem with this at all - everything runs with no issues.

I can be sure that the custom event (and resultant actions) are not at fault here. 

The program only breaks when I try to sent commands via the interface controls.  It won't happen immediately - after continuously making changes, eventually it will give me the 'unable to queue asynchronous operations' error.  It's almost as though the extra commands are overloading it.

Where and how should I close my session?  As it stands, I create a new session only once for each instrument (when I start the software).  From then on, the SRQ events etc are continuously being fired and data requested. 

I'd really appreciate any help you could offer me.

Many thanks,

Chris
0 Kudos
Message 7 of 9
(5,701 Views)
Incidentally, I've just been testing things more thoroughly and have found that if I choose something an instruction on the interface and allow time for it to complete, there is never a problem.  If I select another instruction eg. change range before the instrument has completed the previous instruction eg. set voltage, that's when it crashes....
0 Kudos
Message 8 of 9
(5,696 Views)

Chris,

You are in fact correct you do need to allow commands enough time to execute.  If send too many commands without them executing you can cause an overrun.  With regard to how and when you are supposed to close a VISA session please the see, National Instruments\NI-VISA\Examples\MStudioVC2005, these examples should be located on your computer.  You should close NI-VISA session every time you are finished with a resource.

A_Ryan
AES
National Instruments
0 Kudos
Message 9 of 9
(5,680 Views)