Author Topic: TCP Data acquisition DMM6500  (Read 186 times)

0 Members and 1 Guest are viewing this topic.

Offline VoulezTopic starter

  • Newbie
  • Posts: 2
  • Country: cs
TCP Data acquisition DMM6500
« on: September 03, 2024, 07:50:18 am »
Good afternoon,

I found python script in Data Logging of Power Profiles from Wireless IoT and Other Low-Power Devices to stream digitized current readings over a LAN connection to an external computer. However when I run it I get values that don't match the values I get on the front panel of device. I have tried to decode data that I get but it won't work. Is there something that needs to be modified in these scripts? I provided scripts in text format.
Thanks in advance

Best regards,
Vukasin Pavkovic
 

Online ArdWar

  • Frequent Contributor
  • **
  • Posts: 687
  • Country: sc
Re: TCP Data acquisition DMM6500
« Reply #1 on: September 03, 2024, 10:23:18 am »
Your python script didn't decode the data properly. Please read how format.REAL32 works.

Here an example how to decode the datastream. Not the prettiest nor most efficient but at least it works (for me)
Code: [Select]
def write_block(ofile, floats):
    r = 4    #REAL32
    data = [floats[x:x+r] for x in range(2, len(floats)-1, r)]
    for f in data:
        ofile.write("{0:.4e}\n".format(struct.unpack('f', f)[0]))
 

Offline VoulezTopic starter

  • Newbie
  • Posts: 2
  • Country: cs
Re: TCP Data acquisition DMM6500
« Reply #2 on: September 03, 2024, 11:22:19 am »
Well thank you so much!
I am not very good with python and data formats  :(
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf