From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Agilent/Keysight E4980A Fixed Sweep VI

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Instrument Control

    Software

  • LabVIEW

    Driver

  • NI VISA

Code and Documents

Attachment

Overview

A new version of the example and a new VI to add to the previous library to show how Agilent E4980 works with frequency sweep.

 

Description

It is saved along with the regular Fetch Measurement Data.  It should be in instr.lib\Agilent E4980\Public\Data\Low Level assuming you placed the library in the intr.lib. This VI does an actual sweep in the LCR meter. 

 

Requirement

  1. LabVIEW 2012 (or compatible)

 

Additional Information or References

 

The sweep VI included in the driver on NI's website does not work.  There are a couple of issues with it.

 

  1. The Display Page was never changed to the sweep list.  This resulted in the VI setting up everything, bust just doing a regular measurement.
  2. The Meaurement VI only grabs one result.  I had to create a new VI for the library to handle the results of the fetched list, as the same command is used for a single measurement and a sweep measurement.

 
UPDATE (6/10/2015): Updated the code, as I had originally left the default 512 character request for the fetch, which is not big enough for large sweeps.  I changed the code to allow the value to be specified, and changed the default to 4096.
 
UPDATE (6/7/2016):  Added LV8 version of the VIs.  Rename them to drop the "80" at the end of the VI name.
 
UPDATE (9/27/2016):  Someone noticed that the Fetch for LV8 was still in LV14.  It has been updated.

 

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
krittanat456
Member
Member
on

Hi Matthew_Kelton

First,I sorry for my langauge,I'm a native.

I'm student and I'm a beginner in labview.I want to display list sweep 201 value on lcr meter is controled via My PC and I also download instrument driver form labview.When i'm connected lcr meter with my notebook,it can runs only three point(1000,2000,5000) which it's not my expect.I don't know how to setup your attached and how to add a new VI to the library when I'm double click Agilent E4980 Read Measurement List Sweep.viit tell me some file has been deleted (I guess Fetch Measurement Data (List).vi)  Could you tell me in details please? 

Thank you so much

Matthew_Kelton
Active Participant
Active Participant
on

Agilent E4980 Read Measurement List Sweep.vi is an example to show you how to properly do a sweep on the LCR meter.  It has default values that are 1000, 2000, and 5000.  You need to change these values to sweep a different set of frequencies.

Copy the Fetch Measurement Data (List).vi to Public\Data\Low Level directory of where the Agilent library is.  This may be, for example, C:\Program Files (x86)\National Instruments\LabVIEW 2014\instr.lib\Agilent E4980\Public\Data\Low Level, but depends on your version of LabVIEW, and assuming you put the Agilent library in the instr.lib folder.

Copy the Agilent E4980 Read Measurement List Sweep.vi to the Examples directory of where the Agilent library is.  This may be, for example, C:\Program Files (x86)\National Instruments\LabVIEW 2014\instr.lib\Agilent E4980\Examples.

To add the files to the library and project, open the Agilent E4980.lvproj, which is in the root of the library install (again, for example, C:\Program Files (x86)\National Instruments\LabVIEW 2014\instr.lib\Agilent E4980).

Once the project is open, you should see an Examples folder.  Right-click on it and choose Add->File...  Then select the Agilent E4980 Read Measurement List Sweep.vi file.  Now, the example should be in the project.

Back in the project, you should also see Agilent E4980.lvlib.  Expand it so you can see Agilent E4980.lvlib\Public\Data\Low Level.  Right-click on the folder, and choose Add->File... and choose Fetch Measurement Data (List).vi.

Save everything, and the example should not complain about any missing code.

mqcottinet
Member
Member
on

Hi,

I have Labview 2012 so I could not read your VI fields. If it is possible, can you please send me the 2012 version.

Thanks you so much.

Matthew_Kelton
Active Participant
Active Participant
on

I added LV 80 versions of the code.  Rename them and drop the "80" from the end of the VI name before using them.

mqcottinet
Member
Member
on

Thannks for your  help. Your program is amazing ! It does works very well.

Quyen

PA65
Member
Member
on

Hi dear Matthew_Kelton


Do you have any suggestion for my problem:

Frequency sweep from F1 (for eg100 Hz) to Fn (for eg1000Hz) with specific steps for eg 100Hz, and obtain 2 different output (such as Cp and Rp) for each frequency, using Agilent E4980 driver vi's.


another question: In Read Measurement list sweep  code what is the high and low band limit? If frequency sweeps are our inputs what are outputs? how can we define them? How can obtain for eg Rp and Cp?


Thank you in advance

mqcottinet
Member
Member
on

Dear Matthew_Kelton

I have a problem. The primary and secondary values in the "sweep list VI" are frequently reset to zero (about few seconds, not periodically).

Do you have the same problem ? if yes, do you have any idea how to fix it ?

Thanks you in advance.


Matthew_Kelton
Active Participant
Active Participant
on

If you look at the example, the Configure List Sweep VI has two unwired inputs, Sweep Function A and Sweep Function B.  Have you tried playing with those?  I don't have the hardware anymore, so I cannot do any testing.  If that doesn't work, you may have to do the sweep twice, configuring for each measurement.

Matthew_Kelton
Active Participant
Active Participant
on

Are you running that as a subVI?  The unit I believe reports 0 when it cannot do the measurement.  I have code that shows if I get a value less than 1, I changed it to NaN to show the unit couldn't perform the measurement.

PA65
Member
Member
on

Thank you for your reply.

What are high and low band limits?

mqcottinet
Member
Member
on

Dear Matthew_Kelton,

I found the problem ! It is due to the external trigger. When I set Bus triger, it works .

I set the Sweep Function B as None and Sweep Function A as Frequency. I do not well understand what is the difference between the two functions. I appreciate if you could clarify to me.

Thanks you in advance.

benz_sure
Member
Member
on

Hi Matthew,

The Fetch Measurement data (List)80 is still in LV14 version. Would you be able to upload the LV8 version please. This would be much appreciated.

Many thanks.

Matthew_Kelton
Active Participant
Active Participant
on

Sorry about that.  It should be fixed now.

benz_sure
Member
Member
on

Great! Many thanks for your swift help Matthew. 

benz_sure
Member
Member
on

Hi Matthew,

I was able to do 12 sweep measurements.  However, when I increased the number further,

I received an error message: Error -1074000000 occurred at Agilent E4980.lvlib:Error Query.vi, with possible reason(s): Instrument reports: -420,"Query UNTERMINATED" +0,"No error".   Complete call chain: Agilent E4980.lvlib:Error Query.vi; Fetch Measurement Data (List).vi; Agilent E4980 Read Measurement List Sweep.vi.

The error occurred although the instrument was able to finish the whole sweep measurements (i have tried up to 50 sweeps). 

The error-in code I got at Fetch Measurement Data (List) VI is -1073807339 whereas the error out code is -1074000000. 

I have tried to increase the buffer size, but this did not solve the problem as perhaps the error occurred before that VI. Would you be able to shed some lights please? 

Many thanks for your help.

Matthew_Kelton
Active Participant
Active Participant
on

The -1073807339 erorr is a timeout error.  You need to modify the Initialize VI to increase the timeout from the 10000 ms it is currently set to.

benz_sure
Member
Member
on

Hi Matthew,

Great thanks!  You have saved me from many hours of frustation . . .

Thank you once again

natey_dogg
Member
Member
on

Hi Matthew,

How can you change the primary and secondary parameters from Cp and D  to Z and Theta?

Nate

natey_dogg
Member
Member
on

Hi Matthew,

How can you change the primary and secondary parameters from Cp and D  to Z and Theta?

Nate

Matthew_Kelton
Active Participant
Active Participant
on

Nate,

Wire inputs to the Configure List Sweep subVI.  Sweep Functions A and B.

Matthew