From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Program communicating with a serial port freezes randomly

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.

 

Laptop Configuration:

Windows XP Professional Version 2002 Service Pack 3

32 Bit

Core 2 Duo T5670

1.8 GHz 2.99 GB Ram

 

Desktop Configuration:

Windows 7 Home Premium

64 Bit

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?

 

Thanks.

Archana

 

0 Kudos
Message 1 of 14
(5,668 Views)

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.

0 Kudos
Message 2 of 14
(5,655 Views)

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.

0 Kudos
Message 3 of 14
(5,642 Views)

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.

 

Thanks.

0 Kudos
Message 4 of 14
(5,602 Views)

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.

 

Re:Error clusters...

 

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.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 14
(5,592 Views)

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.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 14
(5,589 Views)

Just one loop hangs up. Its a different one each time.

0 Kudos
Message 7 of 14
(5,586 Views)

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.

 

Matt

 

24256iF5783A6A59043E3D

0 Kudos
Message 8 of 14
(5,536 Views)

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.

0 Kudos
Message 9 of 14
(5,310 Views)

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).

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 10 of 14
(5,306 Views)