05-21-2015 06:22 PM
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.
05-21-2015 08:53 PM
@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.
05-21-2015 10:11 PM - edited 05-21-2015 10:16 PM
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
05-22-2015 07:06 AM
@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.
05-22-2015 07:12 AM
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.
05-22-2015 11:06 AM
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?
05-22-2015 11:59 AM
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.
05-22-2015 12:20 PM
@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?
05-22-2015 02:06 PM
@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()
05-22-2015 07:13 PM - edited 05-22-2015 07:14 PM
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?