09-27-2007 03:40 AM
09-27-2007 06:21 AM - edited 09-27-2007 06:21 AM
Message Edited by Phillip Brooks on 09-27-2007 07:22 AM
09-27-2007 07:06 AM
Thanks for your advice Philip. I had already tried disgarding the error as suggested in the post that you referenced. However I do not have the error input wired, default is no error, so after the error occurs the first time a new error must be being generated every time that UDP read is called, until I stop the VI and restart it. My time out is set to 500ms.
I also found this old thread which I think sounds similar to what I am experiencing:
http://forums.ni.com/ni/board/message?board.id=170&message.id=43971&requireLogin=False
I spent this morning running the LabVIEW VI in the background whilst doing some heavy duty number crunching in Excel and so far the VI has not produced the error, so I am starting to think it is only user interaction in LabVIEW window that is the cause but more testing is required.
Is there a difference between using the 'UDP close' while the main VI is running, and stopping the main VI ?
I.E. does stopping the main VI also flush the UDP receive buffer ?
Thanks !
09-28-2007 06:10 AM
09-28-2007 07:20 AM
Thanks again Philip for your input. When I said 'stopping the VI' I meant exiting the loop that contains the UDP read, closing the UDP connection etc, terminating gracefully, I never use the abort button.
I had already implemented an error counter, similar to what you describe, which when triggerred closes the UDP connection and opens a new one. But as I said this does not help, the very next UDP read produces error 56 again, I have to stop my program (no VIs running) and restart, and then comms are resumed.
It seems to me that the UDP port is getting locked up some how, as I mentioned, I think it is something at the OS level.
10-09-2007 11:48 AM
10-10-2007 11:01 AM
Hi Rob,
Thanks for taking an interest.
The program loop time is determined by the transmission rate of the external device. The speed can be set to different data rates, but I am mainly using 31.25Hz (32ms), although I can increase it to 250Hz (4ms). If I follow your advice about adding tick counts, the value after UDP read - value before UDP read = close to the data rate of the external device, i.e. 31ms at 31.25Hz, 3ms at 250Hz.This suggests that the rest of my code executes in around 1ms.
The exception to this is when I start clicking controls in the LabView window or in other applications such as Explorer, Outlook etc, whereby the time can increase momentarily to around 60 / 70 ms. I believe several of these delays can cause Error 56 if the UDP buffer is not read before my 500ms time-out. It is quite difficult to cause the error though and if the PC is left alone the error does not occur and the program will run for days (maybe forever!). What I don't understand is that once I get an error 56 it does not recover from this condition, all subsequent UDP reads result in error 56 until I stop my program and restart it.
I found this very old link which I think is similar to my problem:
http://forums.ni.com/ni/board/message?board.id=170&message.id=43971&requireLogin=False
It suggests this is a problem with winsock and the windows UI thread, which I guess still exists, as XP came out around 2003.
Up to now I have only tried running my LabView program in the development environment, i.e. as a llb, I am wondering whether it would help to build an executable.
Thanks
Kevin
10-17-2007 09:24 AM
10-18-2007 02:47 AM
Hi James,
Thanks for trying to help. Unfortunately we only have LabVIEW 8.0, we're not on maintenance. Any chance you could post images of the block diagrams ?
Thanks
Kevin
10-18-2007 03:12 AM