LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keithley 2000 Service Request Timing Problem

Hi all,

 

I need to configure the Keithley 2000 such that it triggers every 1second. Then, I would like the instrument to generate  a service request when a reading is available (reading has to be taken every 1 second) so that I can fetch the data.

I saw a pdf online (Using SRQ for Instrument Control over GPIB Bus), and attempted to follow.

 

I did the following:

Configure trigger.vi (for triggering every 1 second) --> Visa Enable Events (SRQ) --> VISA Discard Events (SRQ) --> STAT:MEAS:ENAB 32 ---> *SRE 229 --> *CLS

Wait for RQS --> STAT:MEAS:EVEN? --> FETC?

 

But, I realized that my instrument is not exactly taking measurement every 1 second.

For 100 samples and if each samples takes 1 second, my program should be done in 100 seconds. However, it is taking way longer than ~120 seconds for 100 samples. 

I tried measuring the time taken for each block of functions in my program and realized that my "Wait on Event" vi takes 1.2 - 1.6 seconds to respond. And, i am guessing 1.2s x 100 gives me 120 seconds in total.

 

When I tried increasing the sample rate (configure trigger to occur once in 5 seconds), my "Wait on Event" then takes 5.2 sec to respond.

 

Does anyone know what is wrong? I would greatly appreciate any help. THANK YOU!

 

0 Kudos
Message 1 of 16
(3,171 Views)

Possible to see your code?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 16
(3,132 Views)

Hi Mike, here you go. Thank you for your help.

Please feel free to ask for more clarification if the code is not sufficient.

Thanks!

 

0 Kudos
Message 3 of 16
(3,127 Views)

@yitzoga wrote:

Hi all,

 

I need to configure the Keithley 2000 such that it triggers every 1second. Then, I would like the instrument to generate  a service request when a reading is available (reading has to be taken every 1 second) so that I can fetch the data.

I saw a pdf online (Using SRQ for Instrument Control over GPIB Bus), and attempted to follow.

 

I did the following:

Configure trigger.vi (for triggering every 1 second) --> Visa Enable Events (SRQ) --> VISA Discard Events (SRQ) --> STAT:MEAS:ENAB 32 ---> *SRE 229 --> *CLS

Wait for RQS --> STAT:MEAS:EVEN? --> FETC?

 

But, I realized that my instrument is not exactly taking measurement every 1 second.

For 100 samples and if each samples takes 1 second, my program should be done in 100 seconds. However, it is taking way longer than ~120 seconds for 100 samples. 

I tried measuring the time taken for each block of functions in my program and realized that my "Wait on Event" vi takes 1.2 - 1.6 seconds to respond. And, i am guessing 1.2s x 100 gives me 120 seconds in total.

 

When I tried increasing the sample rate (configure trigger to occur once in 5 seconds), my "Wait on Event" then takes 5.2 sec to respond.

 

Does anyone know what is wrong? I would greatly appreciate any help. THANK YOU!

 


See also here

 

That driver may have a small problem


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 16
(3,121 Views)

One big problem is that you have a race condition in getting your start timestamp. The GPIB write is in parallel with the node that returns the current time. Realistically, what you are seeing is probably the time including at least part of the write operation. Modify the code so the start time is read after the write is done and the stop time is read after the wait but before enything else gets done.

 

Mike...

 

PS: Please tell me you don't really use sequence structures in your deliverable code...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 16
(3,120 Views)

Hi Mike,

 

I changed my code as you suggested ("Modify the code so the start time is read after the write is done and the stop time is read after the wait but before enything else gets done."), but the results were the same.

The sequence structures are for debugging purpose 🙂

0 Kudos
Message 6 of 16
(3,110 Views)

Hi Jeff,

 

Thank you for your suggestion! 

 

I have these drivers installed http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E960B659CE034080020E748... , which I think is the latest drivers provided?

I also don't have a time out issue. My program works, the instrument samples, generates a service request and I am able to collect data. My problem is the time it took to collect data is way off than what is expected.

 

 

0 Kudos
Message 7 of 16
(3,107 Views)

I realized that the settings on my Keithley meter could have made some difference.

My initial problem has NPLC = 4 and FILT OFF and AUTOZ ON (by default).

With NPLC = 4 and sample rate of 1 sample per second, the KE2000 generates a service request every 1.2 sec.

 

When I reduced NPLC to 0.1 (with the same sample rate of 1 sample per second), it seems like the KE2000 generates a service request in less than 1 second (0.997sec).

I am totally confused! 

 

 

0 Kudos
Message 8 of 16
(3,101 Views)

What is NPLC?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 16
(3,098 Views)

Number of Power Line Cycles 

*******

 

Copied from Keithley's website:

 

Question: What is NPLC?

Answer:The Number of Power Line Cycles (NPLC) indicates how long an input signal is integrated to obtain a single measurement. Noise introduced from the power line tends to be periodic. If the A/D converter integrates for an amount of time equal to one cycle of the power line noise, then the signal components from the periodic noise can be canceled. Generally speaking, the longer a signal is integrated by the A/D converter, the more accurate the reading result.

The NPLC setting of an instrument allows adjustment of the tradeoff between speed and accuracy.

For 60Hz power, an instrument operating at 1 NPLC can report a new value no faster than at 16.67 msec intervals. For 50Hz power and 1 NPLC, a new value can be reported no faster than at 20 msec intervals.

Typically, the NPLC can be set for values between 0.01 and 10. However, for complete access to the full range of settings programmatic control over the bus is required. Typically, front panel operation limits the choices to SLOW (10PLC), MEDIUM (1PLC) and FAST (0.1PLC). Additionally, some measurement functions can be performed only at a subset of the available NPLC settings, e.g., continuity. Consult your hardware manuals for information on the range of NPLC supported by your specific instrument for the selected measurement function. 

 

0 Kudos
Message 10 of 16
(3,091 Views)