LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

processor management - uses 100% after a few hours

Hi guys,

              i left a test program i'm writing running over night last night, it is logging data to file from a PLC and reading data from files and outputting this via the PLC.

 

It locked up after a couple of hours and task manager showed it was using 100% processor. (the PC is well speced)

 

The data it was handling from the PLC had all been logged correctley to different files with date stamps etc...

 

I'm wondering what could cause the 100% processor usage ?

 

The program is a sequence structure with the last sequence having a loop with a few case/sequence and subVI's in it. But ultimatley the only continouus operation is the loop which has an exicution delay off 1 second.

 

In fact i'll stick a picture on so its clearer.

 

Cheers Zac

0 Kudos
Message 1 of 12
(2,109 Views)

Hi there,

 

The problem you are facing is probably due to the write to spreadsheet file... If you look into that VI , you will see that it opens and closes the file everytime you access it. This means that the PC has to open the file, then search for the last row of the spreadsheet, and then write. As times goes on, the file gets larger and larger, and the CPU will starve searching for that final line.

The best way to avoid this would be to remove the open and and close file VI from this SubVI and place these on the top VI.

 

I hope this helps,

 

Matthieu

Message 2 of 12
(2,100 Views)

Hi there

 

sounds like typical symptoms of memory leakage. Search for references which are opened but not closed during execution.

 

 

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 3 of 12
(2,097 Views)

Hi Zac,

which history length do you use in your chart? You don't need to build your data into two arrays. You can also connect dbl to the write function, or you use only one format into string function.

 

Mike

Message Edited by MikeS81 on 03-03-2009 11:49 AM
Message 4 of 12
(2,093 Views)

Thanks for the info guys,

                                       i will have a look.

 

The chart history length is 86,400 (24hours)

 

Thanks, Zac

0 Kudos
Message 5 of 12
(2,084 Views)

Hi mike,

              i build the data in to two arrays as i have to log it to file as strings (as one of the items is a string i have to convert all the others), if i try to use the string array output on the graph it cocks up the time axis on the graph so i added a second array of dbls just for the graph. Is there a better way to do this ? can i for example convert the one string into a dbl then i dont need the string array.

 

cheers, zac

0 Kudos
Message 6 of 12
(2,079 Views)

Hi zac,

you can use the "Array to Spreadsheet String" function to build your string. If you change the store method, open the file before the loop, close it after and write the values inside of the loop, then you can directly use the "Write to binary file" function.

 

Mike

Message 7 of 12
(2,076 Views)

I have just tried using the "array to spread sheet string" function, but i need to add to this 1 item of data that is allready a string, and i cant see how to do that in your example, i tried a second array (see image) but it messed up position of the data in the file.

 

I have 1 string and 23 doubles that i want in a single file, so to get thses into a single array i was converting all the dbls into strings as i couldnt convert the string into a double.

 

Cheers, Zac

0 Kudos
Message 8 of 12
(2,057 Views)

Hi zac,

sorry, you can use the "Number to fractional String" it also works with arrays (depending on your LabVIEW version).

I recommand the use of the transformation code to remove one build function.

 

Mike

Message Edited by MikeS81 on 03-03-2009 12:31 PM
0 Kudos
Message 9 of 12
(2,049 Views)

 

sorry but i don't see the advantage of using "Number to fractional String", i still have to use one per double and feed these and the string into an array of strings which can't goto the graph (without messing up the time axis), so i need an adtional array of just the doubles, which can go to the graph.

 

cheers, zac

0 Kudos
Message 10 of 12
(2,039 Views)