Hello everybody,
I want to connect to Speedtronic MarkV or MarkVI or MarkVIe with ethernet and read/write data from/to it with Python. I just want to share whatever I found and find a way to do this. May it will be useful for others as well.
The first step, I just want to do it and I never test it before. here is my program (get it from chatGPT) to read from a spintronic MarkVI control system with Modbus:
============================================================================================
from pymodbus.client.sync import ModbusTcpClient
# Define the IP address and port of the Speedtronic Mark V system
ip_address = '192.168.0.1'
port = 502
# Connect to the Speedtronic Mark V system
client = ModbusTcpClient(ip_address, port)
client.connect()
# Read a register value
register_address = 100 # Replace with the actual register address you want to read
response = client.read_holding_registers(register_address, 1)
value = response.registers[0]
# Print the value
print(value)
# Disconnect from the Speedtronic Mark V system
client.close()
============================================================================================
and the code to connect and write data in Speedtronic markVI:
============================================================================================
from pymodbus.client.sync import ModbusTcpClient
# Define the IP address and port of the Speedtronic Mark V system
ip_address = '192.168.0.1'
port = 502
# Connect to the Speedtronic Mark V system
client = ModbusTcpClient(ip_address, port)
client.connect()
# Write a value to a register
register_address = 100 # Replace with the actual register address you want to write to
value = 12345 # Replace with the actual value you want to write
client.write_register(register_address, value)
# Disconnect from the Speedtronic Mark V system
client.close()
============================================================================================
these codes are not tested and I don't have access to a MarkVI for now (but I will soon). I just want to prepare for testing.
Does anyone have such experiences? Is there any simulator for Speedtronic (any version)? I will appreciate it in advance if share them with me.
I want to connect to Speedtronic MarkV or MarkVI or MarkVIe with ethernet and read/write data from/to it with Python. I just want to share whatever I found and find a way to do this. May it will be useful for others as well.
The first step, I just want to do it and I never test it before. here is my program (get it from chatGPT) to read from a spintronic MarkVI control system with Modbus:
============================================================================================
from pymodbus.client.sync import ModbusTcpClient
# Define the IP address and port of the Speedtronic Mark V system
ip_address = '192.168.0.1'
port = 502
# Connect to the Speedtronic Mark V system
client = ModbusTcpClient(ip_address, port)
client.connect()
# Read a register value
register_address = 100 # Replace with the actual register address you want to read
response = client.read_holding_registers(register_address, 1)
value = response.registers[0]
# Print the value
print(value)
# Disconnect from the Speedtronic Mark V system
client.close()
============================================================================================
and the code to connect and write data in Speedtronic markVI:
============================================================================================
from pymodbus.client.sync import ModbusTcpClient
# Define the IP address and port of the Speedtronic Mark V system
ip_address = '192.168.0.1'
port = 502
# Connect to the Speedtronic Mark V system
client = ModbusTcpClient(ip_address, port)
client.connect()
# Write a value to a register
register_address = 100 # Replace with the actual register address you want to write to
value = 12345 # Replace with the actual value you want to write
client.write_register(register_address, value)
# Disconnect from the Speedtronic Mark V system
client.close()
============================================================================================
these codes are not tested and I don't have access to a MarkVI for now (but I will soon). I just want to prepare for testing.
Does anyone have such experiences? Is there any simulator for Speedtronic (any version)? I will appreciate it in advance if share them with me.