LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"Host address was not found" error in udp application, only for address x.x.8.x

Solved!
Go to solution

I'm using CVI 2015 for an UDP application. Everything works well except when I use a destination address of the form x.x.8.x in the UDPWrite function. 

The error I get is

"NON-FATAL RUN-TIME ERROR:   "TESTBENCH.c", line 2685, col 5, thread id 0x00000C54:   Function UDPWrite: (return value == -6813 [0xffffe563]). Host address was not found"

I use destination address in the correct range. As an example, if I use address "232.001.001.101", the application works well, but if I use "232.001.008.101", I get the previous error. This happens even for different address and generally, addresses of the form x.x.8.x. If I use another program to send UDP datagram to the same destination port and address, there is no problem, so I understand that is not a problem of Windows or firewall but it is something inside CVI. Morevore, if I create a distkit and I install the program on a different PC, the problem persists, so it is not a problem related to the pc. Any idea on how to solve it?

0 Kudos
Message 1 of 7
(3,656 Views)
Solution
Accepted by ulivinico

It looks like a bug since if I use the destination address "232.001.8.101" it works!?!

It doesn't work by using "232.001.008.101" !?!

So it looks like we cannot use destination address in the form x.x.008.x for a bug, but we can get round the problem by using destination address in the form x.x.8.x !!

This happens even by usind the demo provided by NI "Simple UDP Writer", so it is not a problem of my software.

0 Kudos
Message 2 of 7
(3,587 Views)

Maybe the function threats the number as an octal because of the leading 0?

0 Kudos
Message 3 of 7
(3,582 Views)

"Maybe the function threats the number as an octal because of the leading 0?"

I think not, because, actually, the problems comes with 008 but even with 009. No problem by using address 007 or 010 etc. I have had problems only with 008 and 009, but I don't know about other bugs because I had to use 008 as address and I discovered it for this. Anyway, by using 8 instead of 008, it works. Hope NI will correct this bug.

0 Kudos
Message 4 of 7
(3,558 Views)

It's surely a problem related to octal numbers.
A numeric constant with a leading zero has to be intended as octal number.


And octal number use 0..7 symbols. So 008 e 009 are illegal octal number.
007 is decimal 7, 010 is decimal 8, just to cite your own "working" examples.


Did you test the return value from function? I bet it was an error code! Smiley Wink

 

The only bug can be in documentation, there is no reference to the exact format of the IP dot decimal notation, or better dot octal, you know.

Carlo A.
Megaris




0 Kudos
Message 5 of 7
(3,522 Views)

The error code returned is this one I wrote in my post:

return value == -6813 [0xffffe563]). Host address was not found

0 Kudos
Message 6 of 7
(3,518 Views)

I missed it from your previous post, Smiley Sad.
So I think the bug is that it emits a wrong code.
It should be something like -6802 kUDP_InvalidAddress or -6804 kUDP_InvalidArgument, or a brand new one for a more specific information.

 

Carlo A.
Megaris




0 Kudos
Message 7 of 7
(3,510 Views)