MB_Client UDP broadcast

Begonnen von learnetk, 16. September 2016, 15:11:25

Vorheriges Thema - Nächstes Thema

0 Mitglieder und 2 Gäste betrachten dieses Thema.

learnetk

Hi Forum,

I am trying to use the MB_Client in Udp mode.The application has a Client and multiple Servers, and i have a few questions in this regard, hope you could help :
- Is it possible to use the MB_Client for Udp Broadcast to multiple servers.
- when the MB_Client recives the data from a servers, how can the client identify the servers(Ip) and its data.

Thanks and warm regards


learnetk

Hi Peewit
Could you please help ..!

Thanks

peewit

the Modbus blocks of OSCAT-Network can not be used with broadcast
sorry

learnetk

Hi Peewit.

Oh thats a bit sad to know broadcast doesnt work with the standard Oscat network library.
Is it possible to get this working with some changes in the MB_Client and IP_Control2 for this special requirement.
I thought maybe in the MB_Client function block if i could set the C_Mode to 5 (Udp+passive+Ip Address) and then
in the IP_Control2 in the UDP_Init if the sockaddr.sin_addr be set to Broadcast, maybe it would work (please correct me).

It would be really nice if you just could suggest a way for me try out. I had found it rather difficult to find a implementation guide for Modbus UDp like the one present for Tcp. If you could suggest something it would be great.

Thanks and warm regards