Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9205 and Keithley SourceMeter 2602A Synchronization with Python

Dear NI Community,

 

I'm currently trying to start a sweep operation (from 0.0015 mA to 0.0055 mA with 3000 steps) with Keitley SourceMeter and at the same time read in voltage values ​​with NI 9205. My problem is that the two processes should be synchronized. I actually already did this synchronization in LabVIEW and now I want to do it with Python.

I have already configured SweepOperation on Keithley SourceMeter and now I am able to have SourceMeter give a signal to trigger NI 9205 via digital I/O channel every time SourceMeter starts SweepOperation. The configuration of NI 9205 is also already done.

 

Here is the code I wrote for a measurement round:

task_lesen.start()
data = task_lesen.read(3000)
system.inst.write("smua.trigger.initiate()")
system.inst.write("waitcomplete()")
task_lesen.wait_until_done(timeout=10)
task_lesen.stop()
system.messdaten = data

 

In the third line SweepOperation is started at SourceMeter. But before the program comes on the third line, the program stays on the second line (data = task_lesen.read(3000)). The program waits here until it receives a signal via the PFIO channel. But to get this signal, the third line must be done first. If I write the second line after the third line, then the signal for trigger is already gone and the NI9205 can't get this signal and doesn't start the measurement either.

I would really appreciate if you would help me with this problem.

 

Best regards

 

Ali EGIN

0 Kudos
Message 1 of 1
(510 Views)