Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Capacitance measurements with Agilent 4980a

Hi, best regards. Im making measurements using the LCR Meter Agilent 4980a. The value of this measurements are displayed on a .vi and also saved in an excel table (using Report Generation Toolkit). My problem comes when I make Capacitance measurements. When I choose to make them, the results are displayed as normal, but when they are saved in the excel file, the low capacitances values (pF) are replaced by 0 F. In the vi I can see the capacitance value, but the excel table becomes full of 0´s F. This only happens with Capacitance, and I guess that is because the small values, because all the other parameters are saved correctly. Any suggestion, comment or solution would be awesome. Thanks mates!
0 Kudos
Message 1 of 5
(4,242 Views)
The most likely reason is numeric formatting. Are you using Append Table to Report? If so, are you using the String or Numeric one? The numeric one has a default of %.3f for the formatting, which is only 3 decimal places. Please show us the code.
0 Kudos
Message 2 of 5
(4,239 Views)
Hi, thanks for your concern. Here is my .vi . Sorry for the mess!
0 Kudos
Message 3 of 5
(4,236 Views)

You appear to be using the Excel Easy Table (num) VI. That polymorphic instance calls the Append Table to Report VI which uses a default of %.3f for the formatting applied to the numbers. You should use the (string) version of the Excel Easy Table and format the numbers yourself to the required precision.

 

Code comments:

  • You should not be calling the Initialize and Close VIs for the driver inside the loop. They should be outside the loop. 
  • It appears that you are essentially just adding one value to the worksheet at every iteration. You do not need to use Insert Cells since you are not inserting the new value at the beginning - you're appending to the end.
  • The operation you're doing with the unbundling of the [1,0] cluster to get the new row is unecessary. Just use the Increment function on the i terminal and wire that to the "row" element of the Bundle By Name.
  • The Initialize Array function can be replaced by a Build Array.
  • You may want to consider just using the Write to Spreadsheet File VI. It has an append input. All you're doing is saving data to a file. You're not doing anything fancy with Excel, such as inserting graphs or calling macros. Thus, you'd be removing a lot of ActiveX overhead by simply using the Write to Spreadsheet File VI.  While that VI writes text files, you can name the file with a .xls extension so you can double-click it to open it directly from Windows Explorer
0 Kudos
Message 4 of 5
(4,219 Views)
Thanks for all your suggestions Mr. smercurio_fc ! I´m going to make the necessary arrangements to see if it works. Any further issue, I would let you know. Thanks again!
0 Kudos
Message 5 of 5
(4,202 Views)