Jump to content
  • 0

Analog discovery 2 data acquisition


G.cavinato

Question

Hello there!!
I'm trying to do capacitance measurements over the time with a Analog Discovery 2 NI edition and save then, as the code on the image below.

But now, I need to implement 2 things in this script, wich I would like to know if it is possible to.
   1) Save the measurements acquired automatically in a file on the computer (like a .txt or anything like that)
   2) Make the script change the  frequency of the Impedance meter as it run ( for example, acquisition 0 to 4 runs in 10kHz and  5 to 9 runs in 5kHz)

If it is possible, how could I implement that on my script ?

Thanks everyone for the attencion!

Capture.PNG

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Hi @G.cavinato

var file = File("~/Desktop/ia.txt") // ~ stands for user home path
file.writeLine("Cap\tPhase") // this will clear existing file, \t stands for tab, see Help/Script for more info 
// ...
Impedance1.Frequency.Frequency.value = 10e3 // set frequency in Hertz for Meter mode
// use Impedance1.Frequency.Start/Stop.value for Analyzer mode

Impedance1.single()
Impedance1.wait()
// ...

file.appendLine(Impedance1.Traces.Trace.getData("Cs")[0]+"\t"+Impedance1.Traces.Trace.getData("Phase")[0])
// The getData returns array and [0] addresses the first element. In Meter mode the array has length of one, so [0] is not really needed.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...