OSCAT Forum

oscat.lib => oscat.lib fuer TwinCAT/CoDeSys => Thema gestartet von: learnetk am 16. September 2016, 15:11:25

Titel: MB_Client UDP broadcast
Beitrag von: learnetk am 16. September 2016, 15:11:25
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

Titel: Re: MB_Client UDP broadcast
Beitrag von: learnetk am 19. September 2016, 08:50:11
Hi Peewit
Could you please help ..!

Thanks
Titel: Re: MB_Client UDP broadcast
Beitrag von: peewit am 19. September 2016, 12:59:15
the Modbus blocks of OSCAT-Network can not be used with broadcast
sorry
Titel: Re: MB_Client UDP broadcast
Beitrag von: learnetk am 19. September 2016, 18:21:36
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