Multicast; Example Ip Code - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

IP Communication
When the message is received at 192.168.0.1, the message will be delivered to the
dvUDPServer
DATA.SOURCEIP
send a response to the client. Since we will no longer need to listen after sending the response, since
there would be no response to the response, we would open the socket using the following:
IP_CLIENT_OPEN(dvUDPClient,DATA.SOURCEIP,DATA.SOURCEPORT,IP_UDP)
Note that UDP with Receive (3) is only available when calling

Multicast

NetLinx can send and receive multi-cast UDP messages. To send a multi-cast UDP message, all you
need to do is specify a multi-cast address and port in the
following:
IP_CLIENT_OPEN (dvIPClient.Port,'239.255.255.250',1900,IP_UDP)
To receive multi-cast UDP messages, you must call the
IP_MC_SERVER_OPEN (dvIPServer,'239.255.255.250',1900)
The NetLinx master will join the multi-cast session and allow you to receive and transmit UDP multi-
cast messages.

Example IP Code

PROGRAM_NAME='IPExample'
(***********************************************************)
(*
(***********************************************************)
DEFINE_DEVICE
dvIPServer
dvIPClient
(***********************************************************)
(*
(***********************************************************)
DEFINE_CONSTANT
nIPPort
(***********************************************************)
(*
(***********************************************************)
DEFINE_VARIABLE
IP_ADDRESS_STRUCT MyIPAddress
(***********************************************************)
(*
(***********************************************************)
194
and the IP address UDP/IP port of the sender of the message will be available in the
and
DATA.SOURCEPORT
DEVICE NUMBER DEFINITIONS GO BELOW
= 0:2:0
= 0:3:0
CONSTANT DEFINITIONS GO BELOW
= 8000
VARIABLE DEFINITIONS GO BELOW
STARTUP CODE GOES BELOW
variables. A UDP (2) socket would be used in this case to
IP_CLIENT_OPEN
IP_CLIENT_OPEN
IP_MC_SERVER_OPEN
(* .Flags
(* .HostName
(* .IPAddress
(* .SubnetMask
(* .Gateway
NetLinx Programming Language Reference Guide
for
DATA_EVENT
.
function such as the
function:
*)
*)
*)
*)
*)
*)
*)
*)
*)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents