Jump to content

String To IP Function Bug


Recommended Posts

I just discovered an intresting bug. When I use the "String To IP" function in LabVIEW 8.5.1 on a Windows PC the functions works fine for all tested IPs. On a LabVIEW RT desctop target the function works almost fine unless you try the IP 255.255.255.255 for UDP broadcast messages.

Windows: 255.255.255.255 >> String To IP >> 0xFFFFFFFF this result is correct!

LabVIEW RT 8.5: 255.255.255.255 >> String To IP >> 0x00000000 THAT IS ABSOLUTELY WRONG!!!

LabVIEW RT 8.5.1: 255.255.255.255 >> String To IP >> 0x00000000 THAT IS ABSOLUTELY WRONG!!!

So you have to work with a workaround when you whant to send an UDP broadcast message via LabVIEW RT 8.5.x

Greetz ... Karsten

Link to comment

I haven't really used UDP and I'm not in front of LabVIEW at the moment. Why would you need to translate 255.255.255.255 to a network address? Doesn't the broadcast primitive accept a string as the target?

In any case, if you think this is a bug, you should report it to NI.

Link to comment

You can use a broadcast UDP Message to search network devices when you don't know their IPs.

When you send an UDP message to IP 255.255.255.255 via a defined port all devices in your subnet receive that message.

If the clients listen on the sepecified UDP port they receive your call and can react on it.

Now you can start a communication whith the devices via IP.

An UDP call on 255.255.255.255 is similar to a "Is anybody their?" message. For example.

The UDP Write VI in LabVIEW 8.5 expects the IP as an U32 not as a sting.

For this conversion you use the String To IP function in LabVIEW.

And this function works different on Windows and RT.

Link to comment

QUOTE (KarstenDallmeyer @ Dec 5 2008, 12:34 PM)

The UDP Write VI in LabVIEW 8.5 expects the IP as an U32.

Which was what I wasn't sure about.

As I said, it's been a while since I used the UDP VIs and I was sure that at least some of them do accept the IP address, just like the TCP primitives.

Link to comment
  • 2 months later...
  • 4 weeks later...

QUOTE (KarstenDallmeyer @ Dec 5 2008, 06:34 AM)

You can use a broadcast UDP Message to search network devices when you don't know their IPs.

When you send an UDP message to IP 255.255.255.255 via a defined port all devices in your subnet receive that message.

If the clients listen on the sepecified UDP port they receive your call and can react on it.

Now you can start a communication whith the devices via IP.

An UDP call on 255.255.255.255 is similar to a "Is anybody their?" message. For example.

The UDP Write VI in LabVIEW 8.5 expects the IP as an U32 not as a sting.

For this conversion you use the String To IP function in LabVIEW.

And this function works different on Windows and RT.

If you know you want to use the broadcast address you can also just simply plop a U32 constant and type in as large a value as you like with at least 11 digits. LabVIEW will truncate it to the max for an U32 which is 2^32 - 1 = 4294967295 = 0xFFFFFFFF which incidentally is the U32 value of the IP adress 255.255.255.255.

So while the String to IP seems to have indeed technically a bug I never would have noticed since I do not go through the turnabout way of using String To IP to pass the broadcast UDP address to the UDP Write node.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.