LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Shareing One GPIB Spectrum Analyzer (HP6562A) Between Two VI's.

I have two test stations that need to share a Spectrum Analyzer.
I've set up a boolean flag to indicate when one VI is accessing the equipment and the Second VI waits until the flag goes false.

My problem occurs evey once in a while when both VI's try to Accress the test equipment at exactly the same time.
When this happens the Spectrum Analyzer freezes up.
Does any body have some example code that allows two VI's to Time share one piece og GPIB eqipment.
0 Kudos
Message 1 of 3
(2,416 Views)
I would suggest that you look at the shipping example called Locking.vi. It uses the VISA Lock and VISA Unlock functions to control access to a single resource. The example shows how it works in a single VI but as the text mentions, it would typically be used in two separate ones.
0 Kudos
Message 2 of 3
(2,416 Views)
An easier method than locking is to build a higher level vi that handles complete commands (writing and reading) to the analyzer. In this way labview will automatically schedule the first caller and put the second (or more) caller on wait.
This synchronisation is perfect for such an application. Locking on visa level is needed when you are running more executables at the same time.
greetings from the Netherlands
0 Kudos
Message 3 of 3
(2,416 Views)