Keithley DMM6500 TSP scripting - Page 1
Forum section: electronics / general

author: owiecc
author_rank: Frequent Contributor
timestamp: September 22, 2023, 08:12:01 am
content: 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 functiondmm.digitize.func = dmm.FUNC_DIGITIZE_VOLTAGEdmm.digitize.range = 10dmm.digitize.count = 100000dmm.digitize.samplerate = 1000000-- Set triggerdmm.digitize.analogtrigger.mode = dmm.MODE_EDGEdmm.digitize.analogtrigger.edge.level = 1.6dmm.digitize.analogtrigger.edge.slope = dmm.SLOPE_RISINGtrigger.model.load("LoopUntilEvent", trigger.EVENT_ANALOGTRIGGER, 1,trigger.CLEAR_ENTER, 0, fast_transient)trigger.model.initiate()waitcomplete()I am trying to set up a edge detect trigger and capture that in afast_transientbuffer. 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 assumetrigger.model.initiate()is not correct in this context.Next problem is how to automatically start the digitizer for theslow_transientbuffer afterfast_transientacquisition is done.

author: owiecc
author_rank: Frequent Contributor
timestamp: September 25, 2023, 01:37:26 pm
content: 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 magnitudefast_transient_time = 1slow_transient_time = 3fast_transient_samplerate = 10000slow_transient_samplerate = 1000fast_transient_count = fast_transient_time * fast_transient_samplerateslow_transient_count = slow_transient_time * slow_transient_sampleratefast_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 transientdmm.digitize.func = dmm.FUNC_DIGITIZE_VOLTAGEdmm.digitize.range = voltage_forwarddmm.digitize.count = fast_transient_countdmm.digitize.samplerate = fast_transient_sampleratedmm.digitize.analogtrigger.mode = dmm.MODE_EDGEdmm.digitize.analogtrigger.edge.level = voltage_forwarddmm.digitize.analogtrigger.edge.slope = dmm.SLOPE_RISINGtrigger.model.load("LoopUntilEvent", trigger.EVENT_ANALOGTRIGGER, 1, trigger.CLEAR_ENTER, 0, fast_transient)trigger.model.initiate()waitcomplete()---- Set slow transientdmm.digitize.count = slow_transient_countdmm.digitize.samplerate = slow_transient_sampleratedmm.digitize.analogtrigger.mode = dmm.MODE_OFFtrigger.model.load("Empty")trigger.model.setblock(1, trigger.BLOCK_DIGITIZE, slow_transient, slow_transient_count)trigger.model.initiate()waitcomplete()if (file.usbdriveexists() == 1) thenif fs.is_dir("/usb1/pulse_data") == false thenfs.mkdir("/usb1/pulse_data")endsavePrompt = 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)elseend

author: Wil_Bloodworth
author_rank: Regular Contributor
timestamp: February 23, 2024, 01:56:21 am
content: Did you figure out the reason for the pause?- Wil

author: owiecc
author_rank: Frequent Contributor
timestamp: February 23, 2024, 08:40:08 am
content: Sorry, no. I ended up sampling the whole pulse with one sample rate so I stopped looking into it. Now it is a question to Keysight application engineers.

author: miro123
author_rank: Frequent Contributor
timestamp: February 23, 2024, 08:54:00 am
content: Hi,How internal Tsp sricpting works ?Lua interpeter is running on one of one of the application processors on DMM6500.https://en.wikipedia.org/wiki/Lua_(programming_language)This approach gives many advantages.Some of them are faster throughput. Sorter time between command and answer.My experience is that is order on magnitude faster than using TSP over ethernet.In your case code below is not executed in zero time.PS; I have used dual buffer strategy to trace data to PC via ethernet for unlimited time. The botleneck was not the Ethernet troughput but swithing between buffers done by TSP script. I achieved soethoing like 40 KSps. Higher rate caused glitches. That said.-Keithley DMM6500 remains my favorite bench DMM due to its versatility and easy to use."waitcomplete()dmm.digitize.count = slow_transient_countdmm.digitize.samplerate = slow_transient_sampleratedmm.digitize.analogtrigger.mode = dmm.MODE_OFFtrigger.model.load("Empty")trigger.model.setblock(1, trigger.BLOCK_DIGITIZE, slow_transient, slow_transient_count)trigger.model.initiate()

author: Wil_Bloodworth
author_rank: Regular Contributor
timestamp: February 23, 2024, 09:45:06 pm
content: Quote from: miro123 on February 23, 2024, 08:54:00 amIt is interesting that the DMM6500 has a Lua interpretor built-in. That would not be important to me... unless it was required by my job.If you're running into the 40KSps limit, you could try caching on the DMM and then only sending data to the PC when you reach a certain memory threshold... kind of how modern logging works. Each log statement isn't sent to the server, they're saved up (cached) and then a large number of them (maybe 1000) are sent at one time. This could increase your overall throughput... as long as you're not interested in 100% "real time" since data would be coming to the PC in pulses.- Wil

author: Wil_Bloodworth
author_rank: Regular Contributor
timestamp: February 23, 2024, 09:46:27 pm
content: Quote from: owiecc on February 23, 2024, 08:40:08 amWorking around the problem is almost always a great solution. Glad it worked for you!- Wil

author: ellboy
author_rank: Newbie
timestamp: July 04, 2024, 01:29:50 pm
content: Quote from: miro123 on February 23, 2024, 08:54:00 amI have the same task to transfer the data. Could you please share your approach?