Electronics > Metrology

Keithley DMM6500 TSP scripting

(1/1)

owiecc:
I am trying to digitise a pulse that has some fast (<1ms) and very slow (100s) dynamics. I would like to digitise the pulse edge with 1MS/s and the rest of the pulse with a more modest sample rate. I am trying to set-up a script to do that but I do not fully understand the triggering sub-system. This is what I have until now:


--- Code: ---reset()
fast_transient = buffer.make(100000)
slow_transient = buffer.make(5000000)
-- Set the measurement function
dmm.digitize.func = dmm.FUNC_DIGITIZE_VOLTAGE
dmm.digitize.range = 10
dmm.digitize.count = 100000
dmm.digitize.samplerate = 1000000
-- Set trigger
dmm.digitize.analogtrigger.mode = dmm.MODE_EDGE
dmm.digitize.analogtrigger.edge.level = 1.6
dmm.digitize.analogtrigger.edge.slope = dmm.SLOPE_RISING
trigger.model.load("LoopUntilEvent", trigger.EVENT_ANALOGTRIGGER, 1,
   trigger.CLEAR_ENTER, 0, fast_transient)
trigger.model.initiate()
waitcomplete()

--- End code ---

I am trying to set up a edge detect trigger and capture that in a fast_transient buffer. I can do that from the front panel but the trigger does not activate (never goes to the wait state) with my code. What am I doing wrong. I assume trigger.model.initiate() is not correct in this context.

Next problem is how to automatically start the digitizer for the slow_transient buffer after fast_transient acquisition is done.

owiecc:
This is what I got so far. It runs ok but there is a delay between fast and slow sampling. I am hunting for the cause of the pause.


--- Code: ---reset()

voltage_forward = 1.5 -- approximate max measured magnitude

fast_transient_time = 1
slow_transient_time = 3

fast_transient_samplerate = 10000
slow_transient_samplerate = 1000

fast_transient_count = fast_transient_time * fast_transient_samplerate
slow_transient_count = slow_transient_time * slow_transient_samplerate

fast_transient = buffer.make(fast_transient_count)
slow_transient = buffer.make(slow_transient_count)

fast_transient.clear()
slow_transient.clear()

fast_transient.fillmode = buffer.FILL_CONTINUOUS

---- Set fast transient

dmm.digitize.func = dmm.FUNC_DIGITIZE_VOLTAGE
dmm.digitize.range = voltage_forward
dmm.digitize.count = fast_transient_count
dmm.digitize.samplerate = fast_transient_samplerate

dmm.digitize.analogtrigger.mode = dmm.MODE_EDGE
dmm.digitize.analogtrigger.edge.level = voltage_forward
dmm.digitize.analogtrigger.edge.slope = dmm.SLOPE_RISING

trigger.model.load("LoopUntilEvent", trigger.EVENT_ANALOGTRIGGER, 1, trigger.CLEAR_ENTER, 0, fast_transient)
trigger.model.initiate()

waitcomplete()

---- Set slow transient

dmm.digitize.count = slow_transient_count
dmm.digitize.samplerate = slow_transient_samplerate

dmm.digitize.analogtrigger.mode = dmm.MODE_OFF

trigger.model.load("Empty")
trigger.model.setblock(1, trigger.BLOCK_DIGITIZE, slow_transient, slow_transient_count)
trigger.model.initiate()

waitcomplete()

if (file.usbdriveexists() == 1) then

if fs.is_dir("/usb1/pulse_data") == false then
fs.mkdir("/usb1/pulse_data")
end

savePrompt = display.prompt(display.BUTTONS_NONE, "Saving data...")

timestamp = os.date('%Y-%m-%d %H-%M-%S')
buffer.save(fast_transient, "/usb1/pulse_data/fast_transient " .. timestamp, buffer.COL_BRIEF)
buffer.save(slow_transient, "/usb1/pulse_data/slow_transient " .. timestamp, buffer.COL_BRIEF)

display.delete(savePrompt)

else

end

--- End code ---

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod