Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

error -410 after sweep

Solved!
Go to solution

I'm programming a Keithley SourceMeter 2430 to run a sweep. Using similar code for non sweeping I've never had a problem. I'm running a sweep over the GPIB-USB-HS. First time through works fine but when I try to get a second set of readings I get the -410 Query interrupted error. If I restart my software I can again get one set of measurements before the error. I've been fighting with this for a couple of days and I need some help.

Here's my code.

Thanks

 Richard Hutchings

 

 ControlObjects.Keithley2430.Write("*RST")
        ControlObjects.Keithley2430.Write(":SOUR:CLE:AUTO ON")
        ControlObjects.Keithley2430.Write(":SENS:FUNC:CONC OFF")
        ControlObjects.Keithley2430.Write(":SOUR:FUNC CURR")
        ControlObjects.Keithley2430.Write(":SENS:FUNC ""VOLT:DC""")
        ControlObjects.Keithley2430.Write(prot)
        ControlObjects.Keithley2430.Write(startSweep)
        ControlObjects.Keithley2430.Write(stopSweep)
        ControlObjects.Keithley2430.Write(stepSweep)
        ControlObjects.Keithley2430.Write(":SOUR:CURR:MODE SWE")
        ControlObjects.Keithley2430.Write(":SOUR:SWE:RANG AUTO")
        ControlObjects.Keithley2430.Write(":SOUR:SWE:SPAC LIN")
        ControlObjects.Keithley2430.Write(trigCount)
        ControlObjects.Keithley2430.Write(":SOUR:DEL 0.1")
        ControlObjects.Keithley2430.Write(":READ?")
        Sleep(10000)
        readString = InsertCommonEscapeSequences(ControlObjects.Keithley2430.ReadString())
        VI = Split(readString, ",")

 

0 Kudos
Message 1 of 6
(6,214 Views)

Hi DickHutchings

 

But how are you running the second sweep, because in your code I do not see any loop or iteration. When you iterate or run the sweep again to which line of your code are you returning? Has the referenced been closed or maybe you are trying to create a new reference for the same port.

 

Regards

Esteban R.

0 Kudos
Message 2 of 6
(6,204 Views)

This is a subroutine that gets called by a button. I solved the problem by adding this. Keithley2430.Clear(). I don't know if this is the right way but it works.

Thanks

 

Now I'm trying to figure out how to check the status of the sweep so I don't have to use a long Sleep() statement. Any ideas on that or shoud I staert a new thread?

0 Kudos
Message 3 of 6
(6,197 Views)

Hi DicHutchings

 

It seems that the driver that you are using is the Keithley driver on not the NI driver. I think that that clear function will close the reference but I am not sure. That solution should work, but keep in mind that if you are constantly creating and closing the reference you are unnecessary repeating code and eventually might generate an error. From my point of view it will be better to initialize the port, run the sweep on the subroutine and at the end of the execution close the reference.

  

It will be better to create a new thread, but if those drivers are from keithley it might be better to post the question in a Keithley forum

 

Regards

Esteban R.

0 Kudos
Message 4 of 6
(6,183 Views)

These are right out of the NI DLL. Imports NationalInstruments.NI4882. The Keithley device could have just as easily been named Device1. I just give all my equipment names I can recognize. I'll do as you suggest and check on the Keithley forums as well.

Thanks

0 Kudos
Message 5 of 6
(6,169 Views)
Solution
Accepted by topic author DickHutchings

Both problems are solved now. I found that if I don't put any delay at all, the readstring statement somehow pauses the vb code until the sweep is done.

0 Kudos
Message 6 of 6
(6,155 Views)