From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement, visualization and saving data in parallel: Performance question

Hello,

 

I have written an application with 3 loops running in parallel.

 

The first loop does only measure and analyze measurement values from a DAQmx device (3 analog input signals from 3 sensors with 1000 Hz).

The second loop does only do the visualization with a graph per sensor continously. The data will be sent from the first loop through a queue.

The third loop only saves the data to a file after a measurement has finished. The data will be sent at the end of a measurement from the first loop, too.

 

There are 3 measurements running asynchronous.
That means it could be that only one sensor will be read, but it also could be that 3 sensors will be read. The duration of each measurement phase and the beginning/end is asynchronous.

 

Now I have the following problem:

 

  1. Measurement 1 starts
  2. A short time later measurement 2 starts
  3. Measurement 2 will end, the measurement values will be saved into a binary file
  4. Measurement 1 is still running but the visualization of measurement 1 stops for about 1 second during the saving process. After the data is saved, the visualization runs normally again (no data is lost because of the queue).

Why does tha graph stop its visualization during the saving process (I have a dual core cpu)?

How can I do this in a way, the user does not see any lags?

 

It all works fine but the "interrups" look very unprofessional.

 

Regards

Matthias

0 Kudos
Message 1 of 7
(2,990 Views)

Hello Matthias,

 

could you please post your VI /Project?

0 Kudos
Message 2 of 7
(2,959 Views)

Hello,

 

I can write a little demo project later, because the original one includes hundreds of VIs.

0 Kudos
Message 3 of 7
(2,953 Views)

Hi,

 

the Producer / Consumer parallel-loop is a great architecture, which allow you to acquire data using DAQmx , analyze the data and/or write that data to a file.  You can try to analyze your data in the second loop using the Queue funktions, this allows the data to be queued in memory as it is acquired, so the acquisition loop can run at a faster rate.  The data is dequeued in the second loop.

0 Kudos
Message 4 of 7
(2,935 Views)

Hello,

 

I'm using the producer/consumer pattern.

 

Maybe it could be, that the dll calls I'm using for saving will interrupt the whole program: http://lavag.org/files/file/212-sqlite-labview/

When I use the LabVIEW File-I/O vis all is fine. But when I use these database vis my application will lag.

 

Any ideas why this is so? Could it be that the dll calls freeze the application during the saving process (LabVIEW 2011)?

Here are thze dll settings:

 

 

0 Kudos
Message 5 of 7
(2,923 Views)

Hi,

 

which version SQLite are you using? did yoo try with the recommended one?

Version 3.7.15.2 of SQLite is recommended for all new development. Upgrading from all other SQLite versions is recommended.  sqlite

 

 

0 Kudos
Message 6 of 7
(2,887 Views)

Hello,

 

I'm using the correct version of SQLite.

I found the problem, but I can't expalin this behaviour.

 

I had auto population enabled in the LabVIEW project explorer. The directory including the database was auto populated, too.

 

That means, on my development notebook LabVIEW had always access to the database and blocked it sometimes (I don't know why).

Strange is, that on another PC with only the LabVIEW runtime installed, my application (compiled as executable file) had the same behaviour as on my notebook. There were these pauses, too.

 

Then I disabled auto population. On my notebook and on the other PC (!) the executable works now perfectly.

It's unexplainable to me, that the auto population has any influence on the executable built with the application builder.

 

Regards

0 Kudos
Message 7 of 7
(2,881 Views)