LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hard drive crashes

Solved!
Go to solution

Hi

 

I have a really annoying problem with a program I have made as part of a course at university.

I'm combining data from a GPS and a magnetometer to make 2D intensity plots of all sorts of stuff.

 

Anyways, the program seems to be working fine and records data and plots it. My problem occures when I'm trying to save my collected data from different arrays in LabView to a datafile on my HDD. It simply crashes the harddrive, and I'm no longer able to boot anymore. With a Ubuntu live disc I can see that the disc is physically destroyed (SMART-data).

 

I have crashed two HDDs now, and I don't want to try again. It happened at the exact same moment both times. First the computer gets very laggy, and after one minute it shuts down and is no longer able to boot. I'm dualbooting and none of my systems works.

 

Anyone have any idea what could be happening? I have never heard about software so easily corrupting hardware?

 

 

I have included the .vi. It's probably very messy, since we didn't use a lot of subVI's, but maybe it can help (and it is our first LabView program).

 

The notes are in Danish, but the top flat structure is the GPS system, the middle one the magnetometer system and the bottom one collects data from both and make a plot.

 

 

Made using version 8.5

 

 

Hope someone can help with this _very_ frustrating problem! Thanks

0 Kudos
Message 1 of 6
(2,496 Views)
Solution
Accepted by topic author JohnMcJohnson

Your program has several serious problems, but I am not sure why it is destroying your hard drives.

 

1. You have multiple infinite loops. Wiring a False constant to the stop terminal means you can never stop the program except by usnig the Abort button.  The Abort button is only intended to be a way for a programmer to stop defective code during development.  Some one on the Forums has stated that "Using the Abort button to stop a program is like using a tree to stop a car.  It works but may have undesirabel consequences!" One thing which will always happen when you stop your program that way is that none of the file references will ever be closed.

2. You have multiple local variables. LabVIEW is a dataflow language.  The wire is the variable.  Except for a few situations such as initializing a control, it is almost never necessary to use locals.  Disadvantages are slow execution, race conditions, and may create extra copies of the data.

3. You have multiple event structures. The way you are using them may not cause failures of this program, but if you continue to program this way, you will almost cetainly have problems in the future. Generally they should be in a separate loop which only responds to user inputs and then sends commands and data to the loop which do the actual work.

4. You are building arrays inside a while loop.  The compilier and the execution engine cannot determine the ultimate size of the arrays so frequent memory reallocations will occur as the arrays grow. Data in arrays is stored in contiguous memory locations, so it may not take too long to fragment memory enough that LV and the OS can no longer successfully allocate memory.  This will cause programs to slow down and eventually fail.  Usually LabVIEW's memory manager is pretty good about catching this error.  You are not reporting errors, so it is hard to see what is happening.  I have no experience with LV on Linux, so I do not know how that might affect things.

5. Most of your sequence structures wuold be unnecessary if you used the dataflow paradigm effectively.  Let the wires control the order of execution where needed.

 

 

There are other things but most likley your crashes are related to some combination of these.

 

Lynn

Message 2 of 6
(2,487 Views)

Hi, and thanks for your quick reply.

 

I sounds like we have a lot of cleaning up to do!

 

The program is crashing under Windows 7 - I haven't got LV on Linux.

 

- - -

 

But have your ever heard of destroying hard drives just by running bad code?

0 Kudos
Message 3 of 6
(2,478 Views)

You are aware of that 8.5 is not supported under Windows 7 ?

0 Kudos
Message 4 of 6
(2,474 Views)

Hi JohnMcJohnson,

 

Have you found a solution to this problem?

 

Are you sure the dll is working as expected?

Regards,
Eirikur Runarsson
0 Kudos
Message 5 of 6
(2,422 Views)

Hi

 

Yes, we have rewritten the code using 'johnsold's tips, and haven't had any problems since.

 

But I still find it weird that we were able to crash two harddrives...

 

0 Kudos
Message 6 of 6
(2,416 Views)