Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview program freezes but windows is ok!

Solved!
Go to solution

Hi, I'm experiencing a really anoying problem with my program developed in LabVIEW 7.1.

Here is my explanation of my entire application:

 

An old PC had a failure on its hard drive and it was a really old PC running QBasic program controlling some acquisition for an Assembly machine controlled by a PLC.

 

So, I developed a new program in LabVIEW in order to replace the QBasic Program.

The PC is using serial communication, analog signal acquisition, I/O and GPIB.

 

First of all, the Assembly machine has a Mitutoyo scale which uses a ISA board as interface for the PC. So I need a PC with ISA ports (long time obsolete, but it is a really old assembly machine).

Any way, I installed Windows XP SP2 (Spanish Version) to the Pc and it has 512MB in memory and the Processor is Pentium 4. The Motherboard is a Soyo SY-P4I845PEISA. Ok, I think this will give you a good idea of what kind of PC I am using.

So I couldn't use a newer PC due to the ISA board for the Mitutoyo scale (I am searching a new PCI version at this moment), and that is why I had to stick with this old PC.

Ok,

1. The assembly machine has two Servo Motors and I am using serial communication to program those motors by the Servo Drive.

2. The ISA board is using like 8 internal ports (like parallel port 378) but starting from 300h.

3. I am using a NI USB 6008 to acquire two analog signals, voltage in both cases. One is coming from a load cell transducer to detect applied force to the assembled part(-+5 volts max) and the other is measuring millivolt drop(typically around 50mv).

4. GPIB interface to control a Xantrex power supply to apply 2.5 volts and 10 Amps to the assembled part. (From this part I am measuring the millivolt drop)

5. I am checking some sensors from the assembly machine using the USB 6008 I/O and also I am using a Measuring Computing 8/8 Sense which is just like another USB6008 but with 8 bits out-port and 8 bits in-port isolated with relays and something else.

 

So, I did a fancy program to show like histograms to show data from the scale(thounsands of inch) and the load cell(Pounds) and counters and more information(I can attach my program if some body really need it to help me fix my issue)

The problem is that after some machine cycles the labView program just freezes and that's it! I cannot debug and I don't received any acquisition errors or other type of errors from labview, it just freezes.

While LabVIEW is not responding, Windows is just fine so I can open Task manager and kill my program.

Before completing my entire program I tested every single operation one by one and I did not have problems. but when I put everything together is just keep freezing.

 

Since I know the PC  I'm using is really old and most likely slow I adjusted the program so it won't cosume all the CPU resources. So I checked every loop I have in the program and I put a "Until Next multiple" time-delay of at least 100msec, in some other cases when it was possible I put 250 or 500msec.

But there is one part of the program when I have a loop reading in 5 msec period the millivolts. This is because I need to be really accurate when the test is done and then I need to measure with the scale in thounsand of a inch which need to be really accurate. Any way, this loop last about 2 or 3 seconds and maybe 4 at the most.

In order to see if this was causing the program to freezes I checked the CPU usage during this moment and the CPU usage increased up to 80% at the most. most of the cases is about 65~70%, but only during this 2~3 sec. The machine cycle is not fast at all, it is about 6~7 part per minute. Which means that most of the time the CPU usage is at the minimum (lower than 20%).

 

I detected a problem with the Variable Engine Service which was stopping a lot for no reason (according to windows Service manager) and then I reinstall the whole LabVIEW(I removed everything first, all drivers, everything) but the program keeps freezing and I don't know why.

I hope that with this information somebody might have a clue why this might be happening.

0 Kudos
Message 1 of 9
(6,390 Views)

and I put a "Until Next multiple" time-delay of at least 100msec, in some other cases when it was possible I put 250 or 500msec.

 

never think that wait until next multiple waits !

It does, but the first wait can be anything between 0 and n ms.

use the wait ms instead

and better synchronize by wiring instead of waiting

greetings from the Netherlands
0 Kudos
Message 2 of 9
(6,389 Views)

So, Are you saying tat this is causing my program to get frozen?

I know something about the wait ms and I am actually using it but in different areas. I am using the wait until next  multiple wait in While loops only

0 Kudos
Message 3 of 9
(6,387 Views)
No, it is not freezing your program but also no real wait guaranteed.
greetings from the Netherlands
0 Kudos
Message 4 of 9
(6,360 Views)

Hi jcasilla2,

 

Does this happen if you run your application with Highlight Execution on? If so, what part of you application is it crashing on? It may help debug this. Thanks!

 

Thank you for choosing National Instruments.

 

Aaron

National Instruments

Applications Engineer

http://www.ni.com/support 

0 Kudos
Message 5 of 9
(6,353 Views)

Hi Aaron,

The problem is that this is not a small program, and I noticed that the program is not freezing at the same spot all the times.

But, you have a good point. I will try just with the acquisition routine and see if I can find the problem.

 

Also, Some times the program last more that 60 cycles and sometimes not even 10 cycles and that's it.

 

Many thanks for your input.

0 Kudos
Message 6 of 9
(6,348 Views)
Try unplugging the 6008 when you are frozen.  If LabVIew takes off after that (even if the app gets tons of errors) look here
Message Edited by Jeff Bohrer on 02-04-2010 01:31 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 9
(6,309 Views)
Solution
Accepted by topic author jcasillas
Hi Jeff,

At first I was getting errors with the USB 6008 and then I bought a USB hub with external power supply and seems that the problem with the 6008 got fixed.

Also, I just found the problem with the freezing issue and it was caused by the Measuring Computing usb device I am using. The problem is that this device is like getting in sleep mode or something like that and for some reason LabVIEW just freezes and it doesn't give me any error at all.When I was having problems with my 6008 LabVIEW always showed me an error or at least it was responding even though the result was wrong. But, with this “Measuring Computing" device LabVIEW just freezes. It is strange because this is not the first time I use LabVIEW to control these type of devices and that never happen to me before. 

 

Thanks everyone for your help on this matter.

0 Kudos
Message 8 of 9
(6,304 Views)
Glad you found a work-around.  I see the same thing often with both NI an Measurement computing USB devices.  (Pssst....  NI owns Measurement Computing Smiley Wink )

"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 9
(6,282 Views)