Compare commits

..

No commits in common. "main" and "v0.0.2" have entirely different histories.
main ... v0.0.2

3 changed files with 5 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{
"modbus-server": {
"address": "172.17.16.202",
"address": "25.7.55.237",
"port": 5020
}
}

View File

@ -7,5 +7,5 @@ spec:
virtualEnv: base # 사용할 가상환경 이름입니다.
package: requirements.txt # 설치할 Python 패키지 정보 파일입니다.(기본 값은 requirement.txt 입니다.)
stackbase:
tagName: v0.0.6 # Stackbase(gitea)에 릴리즈 태그명 입니
tagName: v0.0.2 # Stackbase(gitea)에 릴리즈 태그명 입니
repoName: sampyo-rs232 # Stackbase(gitea)에 저장될 저장소 이릅니다.

10
main.py
View File

@ -19,19 +19,15 @@ async def measurement_weight(port, data):
result = result.replace(' ', '')
result = float(result.replace('\r\n', ''))
result *= 1000
result += 1000
# print(result)
print(result)
# if result < 0.0:
# result = 0.0
if result < 0.0:
result = 0.0
data.setValues(3, 1, [int(result)])
except Exception as e:
print(f'measurement_weight: \n{e}')
port.close()
time.sleep(0.5)
port.open()
pass
await asyncio.sleep(1)