I have a LabVIEW 2009 VI that communicates with two Electronic Loads using serial communication.
The snapshot of the block diagram is attached with this message. (The timer loop is insignificant and does not pose any problems.)
This programs freezes up randomly on any one of the two timed-loops that communicate with the electronic loads. The freezing time has been random ranging from 9 hours to 10 minutes from the time the VI has started running.
The VI is running on a desktop PC, with a PCI multiport serial card.
The same programs runs on a Laptop with two two USB to serial port converters without any problem.
The program freezes up on the desktop even if used with the same USB to serial port converters.
Windows XP Professional Version 2002 Service Pack 3
Core 2 Duo T5670
1.8 GHz 2.99 GB Ram
Windows 7 Home Premium
Intel Core i5 CPU
3.20 GHz 8 GB Ram
Can someone help me understand why the program freezes on the desktop and not on the laptop?
First question, is it necessary to use the timed while loops? Can you try using regular while loops and see if the problem occurs? I know I have read some threads where timed while loops on non-real-time operating systems can cause more problems then they are worth.
Second, once the freezing has occurred, does it ever unfreeze and start working properly again?
Third, can you determine if there is ever a particular spot in the loop where the freezing occurs? Perhaps put some debugging type code in there such as updating an indicator at different points on your serial chain that says "Hey I've reached point A" "I've reached point B" "I've reached point C". See if it gets frozen at different parts of the code or the same part every time.
One thing I noticed is that you have network published shared variables, but you don't have any of the error clusters wired up. Could it be that you're getting a hang with one of these? If the program unfreezes, as Ravens Fan asked, having these error clusters wired up may provide clues as to the cause.
The program freezes at different parts everytime.
And the main point is that the program runs without freezing on a laptop. So I do not think that the problem is in the code.
I have tried the program without the shared variables also, it still freezes. So I don't think the shared variables are the problem.
Older versions of VISA would do that (freeze randomly) so make sure you have the latest and greatest versions of the VISA driver loaded on the machine that locks-up.
When everyuthing is OK ignoring those error cluster is OK. If we are dealing with intermitant issues, then having knowlege of an issue getting at the NSV's will help.
Adding to the above...
NI-Spy will maintain a log of the serial I/O and may shed light on what was happening at the time of the lock-up since there is a lot of Serial stuff happening. It would also let us know if both loops are hanging or just one.
I had the same thing happen running RT (8.5.1?) on FieldPoint.
I never could determine conclusively what the cause was, but I used a semaphore
around each write/read section such that only one serial channel could be active at
a time and I have not had the problem since. In my case there was one loop
communicating small packets continuously and the other sent and received about 20 bytes every
5 seconds so neither loop was really impacted by the small delay.
it has to be win 7 issue, I have exactly the same scenario where a program communicating with the Serial Port hangs on a win7 notebook, but runs flawlessly on an XP desktop.
What usb devices are you using, are the drivers ready for windows7 64bit? I have had very bad results from different usb-232 converters and have had one particular brand causing blue screens (Not the application since it works fine with other brands of usb-232 converters).