LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot got get a sufficient number of samples/second

Solved!
Go to solution

Hi i've been working on a large project for a few month now. The program is going to read 16 analog inputs and 7 digital inputs from a cRIO 9012 a . TPC 2512 touchscreen will be used to interface with the cRIO. As soon as the program starts it records 1 sample a second from each input and stores each in a separate array. When a user specified threshold is crossed from any of the inputs it takes the previous array and appends each to a different array. Now I need it to collect at least 100 samples/sec but i am only getting around 30. The program has become quite large and the processor on the touchpanel cannot handle collecting all of that data that fast. I am trying to make the program more efficient by only executing certain things when they are needed but its not enough. I was wondering if I took all the separate arrays and made 1 2D array would be any faster. 

0 Kudos
Message 1 of 18
(3,336 Views)

Could you re-post in 2009?

 

I have a feeling that this might be something to do with the way you are building and handling your arrays, without seeing the code i cannot be sure. go here. If you follow the link it will take you to a post where the handling of arrays became very slow due to how they where being built. After modifying the code the speed was made 1.5 Million times faster! Might be similar to the issue you are seeing. 

 

Are you using 'Build Array' function when building your arrays? If you are there may be a more efficient way of doing it.

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 2 of 18
(3,320 Views)

I will have to repost it tomorrow morning because I don't have access to my work computer at the moment but I am using the insert into array function for everything. I will repost early tomorrow

0 Kudos
Message 3 of 18
(3,306 Views)

 

 


but I am using the insert into array function for everything

 


 

 

That will be your problem, everytime you do this you are re-sizing your array, this is very inefficient and will slow down your app the larger the array gets. If you can it is better to calculate the maximum array size you will need, use 'Initialise Array', to build an array of this size and then use 'Replace array subset'. This way you are creating an array once and writing to it, the way you are doing it you are basically creating a new array with every write. 

 

Rgs,

 

Lucither.

 

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 4 of 18
(3,302 Views)

Here is my project resaved for 2009. It is under the pumpmonitoringdevice folder. The project is the same name. The VI I am having troubles with is Analog Input (Host)clean. Before you say anything I know the diagram is huge and I am working on that too haha.

0 Kudos
Message 5 of 18
(3,281 Views)

Hi Adam,

 

Its still in 2010, i have this problem a lot too. You need to make sure that you dont make any adjustments to the converted files. If you save then they will save back to your version.

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 6 of 18
(3,272 Views)
0 Kudos
Message 7 of 18
(3,267 Views)

Ok, now recieved. Is late at night here where i live. Will take a look tomorrow.

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 8 of 18
(3,257 Views)

Ok I will start changing everything to replace subset and tomorrow you can let me know your thoughts. Thanks for your help

0 Kudos
Message 9 of 18
(3,254 Views)

Ok well I started porting over replace array subset instead of insert into array but I am having trouble getting the program to insert into the right indexes. When a input triger is crossed it adds the previous 10 samples for each input only once then adds a sample every 10 ms to the array. How do I update the index that fast without adding another loop which will slow the program down?

0 Kudos
Message 10 of 18
(3,231 Views)