Posted Wed, 01 Mar 2023 01:13:38 GMT by Le, Giang
I'm following Keithley/Tektronic the application note "Data Logging of Power Profiles from Wireless IoT and Other Low-Power Devices". Link here: https://download.tek.com/document/1KW-61357-0_DMM6500_Datalogging_Application_Note_080318.pdf
Only change I made is to measure digitized voltage instead of current.
The script run without a hitch but the data file doesn't match the actual measurement. The data file contains just integer between 0 & 252, while the buffer reading reads the correct current/voltage values.
What could be causing this problem?
Posted Thu, 02 Mar 2023 20:25:00 GMT by McKinney, Ty

Are you using the scripts in Appendix A and B of that application note? One thought is that the data here is returned as binary floating point data, it has to be converted to ASCII. If the measurements are right on the box, then likely something is being converted incorrectly. Do you format the data when you write it to the file like in the python example in Appendix A(see attached PNG)

That formats it as a floating point with 4 decimal places and exponent notation.

Posted Thu, 02 Mar 2023 20:41:54 GMT by McKinney, Ty
Ref attached PNG for above post
Posted Fri, 03 Mar 2023 16:48:52 GMT by Le, Giang
Yes, I have the code from Appendix A and the functions.lua file with code from Appendix B. 
I did change in B the line:

dmm.digitize.func = dmm.FUNC_DIGITIZE_CURRENT

to 

dmm.digitize.func = dmm.FUNC_DIGITIZE_VOLTAGE

so I can measure voltage instead of current.

And also use the same formats "{0:.4e}"
When I try to debug, I found that the byte-type variable I receive back from "get_block(s)" is a list of integer instead of floats.
 

Posted Sun, 05 Mar 2023 14:45:13 GMT by C, Andrea
The appendix B code is configuring the instrument to use binary data format (format.data = format.REAL32).<br> Compared to ASCII, this allows fewer characters on the bus for better throughput.<br> <br> To interpret the data, checkout some IEEE754 compliant techniques.<br> I think numpy and fromfile might be useful.

You must be signed in to post in this forum.