"VeeCal" <Sales@...> writes:
Fantastic!
Okay, so this makes me feel a bit better. I was thinking I was the
only one out here that wanted to try this. Something
that has been made abundantly clear to me is to capture the data from
the eeprom before attempting to write to it, just
in case the file becomes corrupted I have a backup copy to restore
from. With this in mind I will work towards a script
to capture this in all instances.
Be careful. The EEPROM clock line is shared with the chopper pins. I'm
assuming they are using some phantom powering of the power sensors
electronics. Likely there were no pins left and they wanted to stay
compatible with older power sensor.
Downside is that you have to wait after writing each byte to the EEPROM.
I used the following script after bricking my sensor a few times:
------------------------------------------------------------
#!/usr/bin/python3
import pyvisa
from functools import partial
import time
import sys
rm = pyvisa.ResourceManager()
inst = rm.open_resource('TCPIP0::192.168.0.50::gpib0,13::INSTR')
#inst.write("DIAG:TEST 16")
i=0
with open(sys.argv[1], "rb") as file:
for char in file.read():
notmatch=1
while notmatch:
print(f'{i}', end='\r')
value = inst.query(f'DIAG1:DET:EEPR? {i},1')
time.sleep(0.1)
if int(value) != char:
print(f'writing offset {i}, data {char}, old {int(value)}')
inst.write(f'DIAG1:DET:EEPR {i},{char}')
time.sleep(0.1)
else:
i = i + 1
notmatch=0
file.close()
--------------------------------------------------------
This reads each byte, and if it differs reprograms it until it
matches. Never ever abort the program, this will brick your sensor. And
it is all your fault if the script doesn't work for you. ;-)