Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Have two different programs using GPIB to communicate to a Keithley Sourcemeter

Hello All,

 

I have this third party program that takes a pulse measurement using a Keithley sourcemeter.  After that measurement is taken, I written a labview program that will use the Keithely to perform another a different type of measurement.  After the labview program is completed, it closes and the initial program resumes control.  When the third party program resumes control, it performs the measurement, but all I get back is zeroes for the voltage and current.  Has anyone tried something like this before?  I think that it should be possible to get the two programs to work together, assuming that both programs are not trying to communicate to the device at the same time.  Some of the conversations that I had with people think that the third party program is the problem, it sets up a session with the GPIB and Keithley.  I am under the impression that since the second program is able to work, it just needs to set up the Keithley back in its original setting.  

 

- Tech Guy 

0 Kudos
Message 1 of 4
(3,608 Views)

Hi Tech,

 

You are correct that the two programs cannot both communicate with the device at the same time.

 

Is the third party program actually taking a measurement the second time or is it just returning default values and not reporting an error?

 

Does the third party program completely re-initalize its communications when it is run the second time or is it assuming that the previous communications session is still in effect?  Does the third party program stop executing between runs or does it just pause?  Have you asked these questions of the third party provider?

 

My guess would be that the third party program does not re-initialize after your LV program runs, even if you restore all instrumetn settings.

 

Lynn

0 Kudos
Message 2 of 4
(3,595 Views)

Hello Lynn,

 

Thank you for the response.  I doubt that I would get an answer from the third party vendor anytime soon.  Here is the answers to your questions...

 

Is the third party program actually taking a measurement the second time or is it just returning default values and not reporting an error?

- As far as I can tell, the third party program does not return an error.  I was doing some reading last night and it might flag something in one of the registers.  I can probably check it in about a day or so.  The third party program acts as it should.  Using NI SPY, it shows some garage in the return call.

 

Does the third party program completely re-initialize its communications when it is run the second time or is it assuming that the previous communications session is still in effect?  

- No, the program does not re-initialize when it runs a second time. 

 

Does the third party program stop executing between runs or does it just pause? 

- The program waits for the user to take another measurement, so it I guess it pauses.

 

Should any of this matter though?  I done something like this by accident about two years ago.  I wrote some code that didn't close the thread until the program close.  Playing around, I opened up two different instances and both programs were able to work.  I was controlling some digital IO.  But it wasn't as complex as the Keithley though.  My experience on these subjects is limited, especially with the GPIB.  I would assume that if the either program did not lock their threads, then it shouldn't be any problems.  That's all I got.  Any thoughts?????   

0 Kudos
Message 3 of 4
(3,585 Views)

The computer only has one GPIB interface (hardware) connected. Each of the applications programs calls a driver (probably VISA) through the OS. It may well be that the third party program expects the VISA session to still be valid when it tries to run again, but depending on what the LV program did, the original session may be gone.  If something like that has happened, the third party program will not be able to communicate with the instrument.

 

Typically only one application can access a driver at a time. Then the driver needs to be released by the first application and re-initialized by the second.  It is somewhat surpising that LV was actually able to talk to the instrument after the other program ran.

 

I have not worked with GPIB much and not at all with NI SPY, but if you can post the NI SPY results, someone with more experience may be able to help.

 

Lynn

0 Kudos
Message 4 of 4
(3,583 Views)