Home AMX User Forum NetLinx Studio

Broadcast address

Hi everyone!
I'm confused with ip_client_open command.
I need to send a broadcast command to 255.255.255.255 ip address.

If I use ip_client_open(dvIP_UDP_Client.Port, 255.255.255.255, 1186, IP_UDP_2WAY)
I get UNKNOWN HOST: 255.255.255.255

But I need exactly this broadcast address
What's the point please?

Comments

  • Not sure if this will fix it or not, but have you tried adding single quotes to the address:

    ip_client_open(dvIP_UDP_Client.Port, '255.255.255.255', 1186, IP_UDP_2WAY)
  • Yeah, I just copy pasted the address in post, but actually I use char[] var instead. Thanks for advice. Also strange if I use 239.255.255.250 ip for example - the reply is successfully connected.
  • AMXJeffAMXJeff Posts: 450
    karageur wrote: »
    Yeah, I just copy pasted the address in post, but actually I use char[] var instead. Thanks for advice. Also strange if I use 239.255.255.250 ip for example - the reply is successfully connected.

    I do not think that "255.255.255.255" is a valid address....

    What is your IP address of your controller and subnet mask?
  • 192.168.2.31, but it actually doesn't matter
    I need to scan the net for devices which only replies on this broadcast udp (255.255.255.255) request.
    I have few diag soft on PC that sends this request on exact this address and the equipment answers instantly.
    And yes - it's valid address. http://en.m.wikipedia.org/wiki/Broadcast_address
  • Here is screen
    udp.jpg 129.9K
  • viningvining Posts: 4,368
    AMXJeff wrote: »
    I do not think that "255.255.255.255" is a valid address....
    ?
    A special definition exists for the IP broadcast address 255.255.255.255. It is the broadcast address of the zero network or 0.0.0.0, which in Internet Protocol standards stands for this network, i.e. the local network. Transmission to this address is limited by definition, in that it is never forwarded by the routers connecting the local network to other networks.
    interesting...
  • Because the broadcast address used 255.255.255.255 may not fall within the scope of the NIC on the master thus causing the UNKNOWN HOST error, you could try the last address of the subnet for the master itself.

    Using 192.168.1.120 / 255.255.255.0 as the address for the master, sending a packet to 192.168.1.255 will broadcast it to the entire 192.168.1.0/24 subnet.

    If the subnet is bigger than a /24 choose the correct "last" address for the subnet, our internal AV network here is 10.1.96.0/22 (mask is 255.255.252.0) making 10.1.99.255 the broadcast address for the /22 network regardless of whether the host is on 19.1.96.x, 10.1.97.x, 10.1.98.x or 10.1.99.x

    As per the quote above, a packet on a broadcast address cannot be routed, so remember that if the destination device does not reside inside the same subnet it won't see the broadcast regardless of using the global 255.255.255.255 address or the local broadcast of x.x.x.255
  • Well, pdabrowski, you're definitely right!
    192.168.2.255 works ok, thanks!
    But there is strage thing:
    I used two masters in this task:
    1) NI-900 v.3.60.453 - I got error with 255.255.255.255 address
    2) NI-3100 v.4.1.430 - I got OK with 255.255.255.255 address

    Could it be the firmware limitations ? Any way to upgrade NI-900 to v.4.x with 32 mb ram?
Sign In or Register to comment.