06-27-2017 12:08 PM
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?
Solved! Go to Solution.
06-30-2017 03:21 AM
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.
06-30-2017 04:39 AM
Maybe the function threats the number as an octal because of the leading 0?
07-03-2017 03:02 AM
"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.
07-07-2017 07:15 AM
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!
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.
07-07-2017 07:22 AM
The error code returned is this one I wrote in my post:
return value == -6813 [0xffffe563]). Host address was not found
07-07-2017 10:55 AM
I missed it from your previous post, .
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.