Compare commits

...

4 Commits
v0.0.2 ... main

Author SHA1 Message Date
support.sampyo 5d5b047f6f Commit message 2024-05-24 05:42:03 +00:00
support.sampyo 58b5077ced Commit message 2024-05-23 06:58:17 +00:00
support.sampyo 50c7cdf2e8 Commit message 2024-05-23 06:55:54 +00:00
support.sampyo 54c6c55f34 Commit message 2024-03-26 08:47:59 +00:00
3 changed files with 9 additions and 5 deletions

View File

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

View File

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

10
main.py
View File

@ -19,15 +19,19 @@ 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)