LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to show some message when UDP Open is timeout?

Hi all,

I just started using labview. I am working on UDP communication.

I have some question. How can I pop up some dialog to show the user when the "udp open block" is timeout? (in the picture show 5000ms)

For example if the udp cannot open in 5000ms, the labview will show "cannot connect" dialog box to the user.

 

please help thank you in advance.

udptimeout.png

0 Kudos
Message 1 of 7
(2,872 Views)

Hi machinez,

 

you should open the context help (with ctrl-h). Then read the help for the function and maybe also the advanced help linked to by the context help!

 

When you have done so, you should wire all outputs of the UDP function. That way you can use the error output of "UDP Read" and react on TimeOut errors. Those errors are given by a distinct error number and it's up to you to show a message. You may use the Simple or GeneralErrorHandler as well...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(2,867 Views)

Thank you GerdW,

I tried checking from the error out node (yellow line) by cluster. it has shown no error (error code=0) even the udp was time out.

I dont know how to do next so. How to get the error code from the block?

 

Thank for your great support

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

Thats because you have not connected the error out from the first block. Connect all the error out / error in connection then check for the timeout error value.

 

Thanks

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 7
(2,822 Views)

Hi Ranjeet,

 

I connected the error out  and got the same result, error=0 even the udp is timeout.

0 Kudos
Message 5 of 7
(2,804 Views)

Can you Attach your VI (In 2011 format) ?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 6 of 7
(2,798 Views)

I haven't seen a case where opening a UDP port times out (maybe firewall settings, or so, can cause this). UDP Open opens a port on the local machine. You won't get a timeout from an unresponsive remote port until you do a read.

0 Kudos
Message 7 of 7
(2,753 Views)