NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Controls_Engineer
Posts: 44
0 Kudos

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

 

Knight of NI
RavensFan
Posts: 16,018
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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.

Knight of NI
Posts: 18,064
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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.

Member
Controls_Engineer
Posts: 44
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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.

Knight of NI
Knight of NI
Ben
Posts: 16,154
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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

Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Knight of NI
Knight of NI
Ben
Posts: 16,154
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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

Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Member
Controls_Engineer
Posts: 44
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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

Active Participant
Matthew_Williams
Posts: 407
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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

Member
Vadim
Posts: 32
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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.

Trusted Enthusiast
falkpl
Posts: 2,346
0 Kudos

Re: LabVIEW Program communicating with a serial port freezes randomly

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