Skip to content

Commit

Permalink
OK
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-JACT committed Jan 10, 2023
1 parent d9e1c1e commit 41987e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/ModbusBruteForce.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

host=console.input(f"[bold green]HOST:[/bold green] ")

port=console.input(f"[bold green]PORT:[/bold green] ")
port=int(console.input(f"[bold green]PORT:[/bold green] "))

ad=console.input(f"[bold green]MAX ADDRESS:[/bold green] ")
ad=int(ad)

ID=console.input(f"[bold green]UNIT ID:[/bold green] ")

if ID == "" or 0:
ID=1
if ID == "" or ID == 0:
ID = 1

client=ModbusClient(host=host, port=port, auto_open=True, auto_close=True, timeout=10)

Expand Down
8 changes: 4 additions & 4 deletions src/testserver/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from time import sleep
from random import uniform

server = ModbusServer("127.0.0.1",12345,no_block=True)
server = ModbusServer("127.0.0.1", 12345, no_block=True)

try:
print("Starting server...")
server.start()
print("Server is running...")
state=[0]
state = [0]
while True:
DataBank.set_words(0, [int(uniform(0,100))])

Expand All @@ -20,9 +20,9 @@
DataBank.set_words(2, [int(uniform(1,200))])
#DataBank.set_bits(0,[int(uniform(0,200))])
"""
if state!=DataBank.get_words(1):
if state != DataBank.get_words(1):
print(f"State: {state}")
state=DataBank.get_words(1)
state = DataBank.get_words(1)
print(f"State: {state}")
sleep(0.5)

Expand Down

0 comments on commit 41987e8

Please sign in to comment.