07-05-2010 06:03 AM
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
Solved! Go to Solution.
07-05-2010 06:48 AM
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 ?
07-05-2010 06:56 AM - edited 07-05-2010 06:59 AM
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...
07-05-2010 07:02 AM
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.
07-06-2010 08:07 AM
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
07-06-2010 08:33 AM
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...