Is modbus TCP possible in next time?
-
- Posts: 108
- Joined: Fri Dec 09, 2022 10:03 am
- Has thanked: 47 times
- Been thanked: 12 times
Re: Is modbus TCP possible in next time?
Whatever is here in Annex Basic is super well thought out, I think it will be good.
And, I'm also sure that Modbus TCP and/or RTU will be well received by users.
Best regards, Helmut
And, I'm also sure that Modbus TCP and/or RTU will be well received by users.
Best regards, Helmut
- cicciocb
- Site Admin
- Posts: 2095
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1385 times
- Contact:
Re: Is modbus TCP possible in next time?
I'm experimenting with modbus TCP in client mode ... seems to work ....
- cicciocb
- Site Admin
- Posts: 2095
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1385 times
- Contact:
Re: Is modbus TCP possible in next time?
Ive just published the version 1.52.6 for the ESP32 and the ESP32-S3 that contains a first initial experimental support for the MODBUS, in TCP slave only.
For info, I've tested using a Modbus simulator (Modbus Slave).
You'll find below a preliminary documentation .
Please test it and let me know
For info, I've tested using a Modbus simulator (Modbus Slave).
You'll find below a preliminary documentation .
Please test it and let me know
Re: Is modbus TCP possible in next time?
Wow, the last time I saw Modbus it was still a serial protocol. Interesting to see Modbus TCP support in Annex!
-
- Posts: 108
- Joined: Fri Dec 09, 2022 10:03 am
- Has thanked: 47 times
- Been thanked: 12 times
Re: Is modbus TCP possible in next time?
I thought I was dreaming, that was the burner. I'll just get around to testing it this evening.
Thanks alot
Thanks alot
-
- Posts: 108
- Joined: Fri Dec 09, 2022 10:03 am
- Has thanked: 47 times
- Been thanked: 12 times
Re: Is modbus TCP possible in next time?
Please help me out:
I want to access IP address 192.168.0.200
Port 4196
Device ID 1
Address 4273 dec.
with read holding register
Read out
What must i write into the modbus.request line ?
Edit 19:45
The code i test is ok:
If i test it with a Ethernet to RS485 i have problem (with adress in top her)
I test it longer, thankyou for this tool !!!
I want to access IP address 192.168.0.200
Port 4196
Device ID 1
Address 4273 dec.
with read holding register
Read out
What must i write into the modbus.request line ?
Code: [Local Link Removed for Guests]
READ_HOLD_REGISTER = 3
'WRITE_HOLD_REGISTER = 6
SERVER_ID = 1
modbus.connect "192.168.0.200", 4196 'address of the remote server
modbus.request 4567, SERVER_ID , READ_HOLD_REGISTER, 4131, 41320
The code i test is ok:
Code: [Local Link Removed for Guests]
'MODBUS example - write and read in the HOLD_REGISTER 0
READ_HOLD_REGISTER = 3
WRITE_HOLD_REGISTER = 6
SERVER_ID = 1
' MODBUS.CONNECT IP$, [port] [,timeout] [,idleTimeout]
onWgetAsync modbus_received 'set the event handler function
modbus.connect "192.168.0.44", 504 'address of the remote server
for z = 0 to 1000
'write to the address 0
'modbus.request 1234, SERVER_ID, WRITE_HOLD_REGISTER, 0, z
'read from the address 0
modbus.request 4567, SERVER_ID , READ_HOLD_REGISTER, 10, 11
pause 1000
next z
end
modbus_received:
r$ = WGETRESULT$
wlog r$
print r$
token$ = word$(r$, 1) 'extract the token (first word)
if (token$ ="4567") then ' if the token correspond to the read request
if (word$(r$, 2) <> "Error") then 'if is not an error
'assemble the 2 bytes in one 16 bits word
value$ = "&h"+ word$(r$, 5) + word$(r$, 6)
wlog val(value$) 'converts from hex to integer
end if
endif
return
I test it longer, thankyou for this tool !!!
Last edited by Helmut_number_one on Fri Apr 12, 2024 5:45 pm, edited 1 time in total.
- cicciocb
- Site Admin
- Posts: 2095
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1385 times
- Contact:
Re: Is modbus TCP possible in next time?
Following your information :
You must use :I want to access IP address 192.168.0.200
Port 4196
Device ID 1
Address 4273 dec.
with read holding register
Read out
What must i write into the modbus.request line ?
Code: [Local Link Removed for Guests]
READ_HOLD_REGISTER = 3
'WRITE_HOLD_REGISTER = 6
SERVER_ID = 1
modbus.connect "192.168.0.200", 4196 'address of the remote server
modbus.request 4567, SERVER_ID , READ_HOLD_REGISTER, 4273, 1 ' adress 4273, 1 register
-
- Posts: 108
- Joined: Fri Dec 09, 2022 10:03 am
- Has thanked: 47 times
- Been thanked: 12 times
Re: Is modbus TCP possible in next time?
Hm....
With the Ethernet to RS485 Connect, the first value returned is incorrect, all the next ones are correct.
I don't have that with devices without a converter.
it is not a mistake from Annex Basic.
Is there a way to delete the first error message?
But, Franzessco, I'm thrilled
The token concept is also great
Without Ethernet Convert:
With the Ethernet to RS485 Connect, the first value returned is incorrect, all the next ones are correct.
I don't have that with devices without a converter.
it is not a mistake from Annex Basic.
Is there a way to delete the first error message?
But, Franzessco, I'm thrilled
The token concept is also great
Without Ethernet Convert:
You do not have the required permissions to view the files attached to this post.
-
- Posts: 108
- Joined: Fri Dec 09, 2022 10:03 am
- Has thanked: 47 times
- Been thanked: 12 times
Re: Is modbus TCP possible in next time?
or can I do something different here?
Edit 21:26
i chanche destination port to my Annex Basic ESP32, but doesn't help....
Edit 21:26
i chanche destination port to my Annex Basic ESP32, but doesn't help....
You do not have the required permissions to view the files attached to this post.
Last edited by Helmut_number_one on Fri Apr 12, 2024 7:32 pm, edited 1 time in total.
- cicciocb
- Site Admin
- Posts: 2095
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1385 times
- Contact: