In my project I need to write negative intager in a PLC 1200 siemens. Now I'm using Pymodbus to write and read my register but I can't find a way to write negative integers because the console show me always this error:
"struct.error: argument out of range"
In this project I'm use Flask
this is my code:
def writeIntRegister(postName, address):
post = request.form.get(postName)
post = int(post)
client.write_registers(address, post)
How I can decode the intager?