I tried:
https://github.com/tektronix/keithley/blob/master/TSP_Apps/Resistance_Tolerance_Meter.tspa
- When starting I get an error, like not correctly initialized.
- When I exit the app the custom buffer stays the selected buffer, maybe this should be set back to the default buffer to avoid this next error.
- I got a few bad reading (high impedance) due to bad contact, so had to press retry but if two follow each other I will not be able to do that.
- It also shows rear terminals in the csv file while I used the front.
Not related to this app, can I make saving the measurements so that the column time is always the first column and the measured value always the second? (makes it easier in excel)
Alas! I blame myself for not testing on the correct firmware. Updated version here:
https://github.com/tektronix/keithley/blob/master/TSP_Apps/Resistance_Tolerance_Meter.tspa- I fixed the indexing error that caused that first error, the MENU will now render correctly as a result.
- Currently, there's no way to execute specific code when you exit an app. The development firmware allows for resetting the instrument when an app exits, which would fix this. Otherwise, since it's a writable buffer, it doesn't really need to be active, but having it active simplifies small things like going to the reading table (so that the results buffer is already up).
- Hmm, should unlimited re-tests be allowed? Was the bad contact just due to it taking a reading while you were still setting up or something else?
- Fixed the mislabeled terminals. Front terminals are actually required for this app... I'm not sure why but I didn't remove that requirement in case there's a reason I didn't see (I didn't write this one).
On saving buffers in a specific way: kinda. There's quite a few different ways to
skin a cat export a buffer. The options are fed as parameters to the buffer.save() function and are documented on page 722 (15-21) of the Reference Manual. The option you probably want is buffer.COL_BRIEF, which saves only the reading and the timestamp (though the timestamp comes second). For the ultimate customization though, writing your own csv is the way to go, that's typically what I do.
Let's say you want to save the relative timestamps and readings from defbuffer1 to a file named "savedbuffer.csv". Here's a code block to do that:
fileVar = file.open("/usb1/savedbuffer.csv", file.MODE_WRITE)
file.write(fileVar, "Relative Time, Reading\n)
for i = 1, defbuffer1.n do
file.write(fileVar, defbuffer1.relativetimestamps[i]..","..defbuffer1.readings[i].."\n")
end
file.close(fileVar)
In the Resistance Tolerance Meter app, the code to save data is at line 83, in the function
save_data_btn_press_event(), should you want to customize it yourself.