Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I check if GPIB bus has available data using SPCI?

I am currently using the NationalInstruments.Common.Native.dll as the library in my Visual Studio 2010 project. I have working projects but something that drives me a little crazy is the fact that the program crashes (only with the oscillscope and not our VNA) when attempting to open the GPIB bus for the oscope before there is a 'capture' initiated on the scope iteself. 

 

Is there a "GpibDevice." query which I can run that will return a TRUE or FALSE whether there is a signal on the BUS? This way I can set a while loop pending the boolean result of the GpibDevice. query.

 

Thanks or any help.

0 Kudos
Message 1 of 10
(6,460 Views)

@high-Q wrote:

I am currently using the NationalInstruments.Common.Native.dll as the library in my Visual Studio 2010 project. I have working projects but something that drives me a little crazy is the fact that the program crashes (only with the oscillscope and not our VNA) when attempting to open the GPIB bus for the oscope before there is a 'capture' initiated on the scope iteself. 

 

Is there a "GpibDevice." query which I can run that will return a TRUE or FALSE whether there is a signal on the BUS? This way I can set a while loop pending the boolean result of the GpibDevice. query.

 

Thanks or any help.


This makes no sense. Why would you attempt to the open the GPIB bus communication to the oscilloscope more than once?

It should be done once.

0 Kudos
Message 2 of 10
(6,452 Views)

It's an autonomous test station with various measurement instruments. I'm closing the bus after reciving the string from each instrument. 

 

So does this mean this is not possible?

 

Arduino has "available()"  http://www.arduino.cc/en/Serial/Available

0 Kudos
Message 3 of 10
(6,444 Views)

@high-Q wrote:

It's an autonomous test station with various measurement instruments. I'm closing the bus after reciving the string from each instrument.


Again, that makes no sense.  Part of the command over the bus is the address.  So if you know all of your instruments' addresses, you just supply that when you iteract with that instrument.  There is no reason to constantly open and close your bus.

 

The problem with checking to see if data is available is that you have to send a querry to the instrument.  You are the master of the bus.  Nobody else can send data without you letting them.  So you have to keep you bus open and send querries to check to see if the oscilloscope is ready to send data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 10
(6,428 Views)

high-Q wrote:

Arduino has "available()"  http://www.arduino.cc/en/Serial/Available


That command is for SERIAL communications.  It has nothing to do with GPIB.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 10
(6,426 Views)

So if I have 3 measurement instruments 1. DMM, 2. Oscope, 3. DC Power Supply. All on the GPIB bus. 

 

If i need to:

1. Check DMM

2. Query the oscope - but query only returns data when the oscope is being triggered

3. Modify the DC Power Supply

4. Check DMM 

5. Check Oscope

6. Check DMM

 

In a sequence like this I just leave the bus open for each device until I'm done? I don't have to open-close for each one?

0 Kudos
Message 6 of 10
(6,413 Views)

high-Q wrote:

In a sequence like this I just leave the bus open for each device until I'm done? I don't have to open-close for each one?


That is correct.  It will make your life a lot easier.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 10
(6,409 Views)

@crossrulz wrote:

high-Q wrote:

In a sequence like this I just leave the bus open for each device until I'm done? I don't have to open-close for each one?


That is correct.  It will make your life a lot easier.


So I can open everything "once" then when I'm doing I can run :

 

        Try
            GpibDevice.Dispose()
            SetupControlState(False)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

 

and it this closes everything?

0 Kudos
Message 8 of 10
(6,404 Views)

@high-Q wrote:

@crossrulz wrote:

high-Q wrote:

In a sequence like this I just leave the bus open for each device until I'm done? I don't have to open-close for each one?


That is correct.  It will make your life a lot easier.


So I can open everything "once" then when I'm doing I can run :

 

        Try
            GpibDevice.Dispose()
            SetupControlState(False)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

 

and it this closes everything?


GpibDevice.Close()

0 Kudos
Message 9 of 10
(6,397 Views)

Hi crossrulz,

 

Re:

 

"That command is for SERIAL communications.  It has nothing to do with GPIB."

 

 

My program still crashes when attempting to read :VPP? on my oscillscope when there is no signal to trigger it.

 

Reason: The test station can be shut down (for saftey) 1. Signal Source is cut 2. VB .NET is interrupted.

 

 Do you have any recommendations on how I could handle this?

Message 10 of 10
(6,385 Views)