09-21-2014 09:39 PM - edited 09-21-2014 09:51 PM
Hello!
Now I want to write programs torealize signal acquisition、signal processing、 contours displaying(using Intensity graph), all these modulus are finished respectively. But the question is how to realize the synchronization among all these modulus? The processing and displaying modulus runtimes are longer than theacquisition modulus.
09-21-2014 11:20 PM
Information is not sufficient enough to help
What is the need of synchronizing the processing and displaying module along with acquisition?
What is the data size that needs to be processed?
What is the loop rate at present in which the processing and displaying module takes more time than the acquisition module?
Thanks,
Vijay.
09-22-2014 09:19 AM
Than you for your reply.
I sorry that all the "modulus" above should be "modules".
First process is data acquisition, the sample rate is 100Msamples/M and the sampling time 50us,that is, 5000 sampling points. The DAQ interval is selectable(500ms,or longer that 500ms). Then the second process is signal processing (like filter, FFT ) and then generate a blocky rectangles of color. These two modules all cost longer than 1s respectively.
My English is poor ,so I attached a picture.
09-22-2014 11:01 PM
Hi,
I guess you are acquiring->Processing-> displaying in a single while loop sequentially otherwise 5000 sample processing should not consume 1s as you described unless you have very bad computer.
One option is split the acquisition and processing & displaying to two different while loops. One while loop for acquiring and another one for Processing and displaying. Use the queue to transfer the data from acquisition loop to processing and displaying loop.
Hope this helps.
Kindly post your source code to understand and help better.
Best regards,
Vijay.
09-23-2014 02:36 AM
Hi,
Now what I am using is just the method that split the two different while loops and use the queue. But the question is the processing &displaying loop really takes more time that the acquisition loop. I have used the Filter—FFT—Matlab script(I think it's really time-consuming ,right or wrong? ) in the precessing module.
the problem of the runtime above maybe OK while I don't need very precise synchronization. But one thing that I really cannot bear is that the processing &displaying loop always start later that the acquisition loop. when the acquisition loop finished the signal acquisition of a point, the displaying loop had just finished the diaplaying of points before the acquisiton point. So the non-sync makes me or users feel very confused. Do you know why? Did the reading/ writing speed difference cause this phenomenon? If it's the spped caused the non-sync,Does that mean I cannot set a high acquisition speed?
Besides, I have an idea thatsolve the the processing &displaying loop runtime problem. I can split the processing&dispalying module into several modules, and use the synchronization functions. In this case, the queue functions cannot be used because the one element in the queue can just be dequeued by once,not dequeued by all the module loops,am I right?
Hope you can understand.
Best regards,
Carrot
09-23-2014 03:15 AM
Hi,
What I understood is that you are already having two loops, one for acquiring and another for processing and displaying.
Why don’t you try using LabVIEW inbuilt FFT VI instead of the Matlab script (which is taking more time).
I don’t think you have any other solution other than optimizing the FFT part since that is taking more time. Even splitting processing and displaying may not help much.
09-23-2014 03:33 AM
Hi
Thank you
the Matlab Script is not for FFT but for some non-destructive detections, and I used the LabVIEW inbuilt VI for FFT. Besides I know the script will be a big trouble when generate the EXE file,but this is the core of our program. Do you have other advises?
Thank you very much.
Best regards,
Carrot
09-23-2014 04:05 AM
Hi,
One way is to rewrite the Matlab Script in LabVIEW. Since it is NDT, kindly refer below link it may be useful.
http://www.ni.com/example/28618/en/
Otherwise, I don’t think there are any solutions.
Regards,
Vijay.
09-23-2014 04:10 AM
Thank you very much.
Your advises will help me a lot
Best regards,
Carrot
09-23-2014 09:07 AM
Hi,
Sorry for disturbing you again.
I have just modified my source code and I found a error in my Matlab script. Now the acquisition·module and the processing&displaying module are nearly the same runtime. But there is a question that when using the queue functions the processing&displaying loop always start later than the acquisiton module,the difference is one loop. I think it's caused by queue itself. So I wonder Is there a method to let the two loops sart at the same time?
Best regards
Carrot