LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increase write to file process speed

Solved!
Go to solution

Dear Sir/Madam

 

I’m a PhD student working in smart home project and I have a problem.

 

I designed a labview program that control 8 multiplexer (32-channel) to acquire 256 signals, the input samples/channel = 2 , and the sample rate is 40KHz.( see the attached program)

The problem is when I add (write to file) instruction the entire process will be slower than before and for sure the signals will be in different shapes.

 

Please, could tell me how I can overcome this problem and increase the process speed?

 

Thank you for your attention in this matter

 

Yours faithfully

 

Ibrahim

0 Kudos
Message 1 of 6
(3,345 Views)

What's the problem ? You write your file once for loop has finished executing, so there will not be any speed problem. Do you plan to put this VI in a while loop for instance ? And even if you plan to do so, You're not likelly to have any speed problem. Did you try ?

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

Hi Ibrahim,

 

the main speed increase will be to get rid of those DAQ-Assistents...

They do work (initialize, de-init) in a loop that should be done outside. In the loop you only should have the actual DAQmxRead/Write commands.

 

As already said: writing the data to a file after the loop has finished will not change your loop timing nor your data.

 

Edit:

There's also a race condition in your code: you run the two Assistents in parallel. How do you know that the DigOut runs before the AnaIn routine? Use error clusters for that purpose.

Another source of "speed loss" might be those 8 waveform graphs. LabVIEW needs some time to update them when new data arrive...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 6
(3,329 Views)
Solution
Accepted by Ibrahimlee

Regarding DAQ assistant, GerdW is right, if the speed is something very important for your application you should refer to LabVIEW examples ("hardware input/output", there are many examples for acquiring/generating data in a loop by using DAQmx palette).

 

Best,

 

J.

0 Kudos
Message 4 of 6
(3,322 Views)

Dear All

 

Thank you so much for your support, I have solved the problem by postponing the write to file instruction until the end of process.

Thanks again for your help

 

Regards

 

Ibrahim

0 Kudos
Message 5 of 6
(3,283 Views)

Hi Ibrahim,

 

It has nothing to do with your speed problem but what GerdW said is very important for your code :

"There's also a race condition in your code: you run the two Assistents in parallel. How do you know that the DigOut runs before the AnaIn routine? Use error clusters for that purpose."

 

Hope it's clear for you...

0 Kudos
Message 6 of 6
(3,274 Views)