12-04-2022 12:54 PM
Gerd is probably having the same problem understanding your (strange-looking) code as I did before I removed the Frame Sequence (see attached). Now the structure looks clearer, and I have some observations and questions.
I hope you will agree with me that this "frameless" version of your VI is much easier to read, much easier to figure out what is going on, and possibly easier to find where it does something different than what you expect (suggesting you found a bug). I've attached my version. Let us know if you can get it to work, now.
Bob Schor
12-05-2022 06:58 AM
Hi Bob Schor,
Thank you so much. Now the error has been solved and able to get exact values from the DAQ.
Regarding your comments, I will try to explain my intention. Not sure whether it makes sense or not.
First of all, I am a beginner at LabVIEW. Hence, don't know about the usual procedures and simple methods. That was the main reason "why the code seems to be so drastic".
My work is to obtain an image of a metallic object using MMW imaging using a row detector of 8 sensor elements. So, by mounting the row detector on a step motor and by making 16 vertical steps (0-15) and 02 horizontal steps (0 and next step according to the step size selected) during each vertical step. Thus, my plan is to generate a 16x16 grayscale image using the row detector.
Regarding the FFT magnitude corresponding to one frequency value - Here I am using a square wave signal of 10KHz frequency so as to modulate the radiation source used for imaging. So, I am only concentrated on that particular value corresponding to the mentioned frequency component.
Also, for the array manipulation my plan was to merge two 16x8 matrix in such a way that first column of the first array will be the first column of the appended array. Then first column of the second array will be the second column of the appended array.. For example if first matrix A is like A01 A02 A03.....and second matrix B is B01 B02 B03 .... Then the final appended matrix will be like A01 B01 A02 B02 A03 B03.......
I think I need to work something in your code to achieve this...right?
Anyway, the main headache was resolved.............. and now the code looks a professional touch and more easy to work with it...
Thank you so much ...Brother
Regards,
Arun
12-05-2022 07:07 AM - edited 12-05-2022 07:07 AM
Hi Arunr,
@Arunr88 wrote:
Also, for the array manipulation my plan was to merge two 16x8 matrix in such a way that first column of the first array will be the first column of the appended array. Then first column of the second array will be the second column of the appended array.. For example if first matrix A is like A01 A02 A03.....and second matrix B is B01 B02 B03 .... Then the final appended matrix will be like A01 B01 A02 B02 A03 B03.......
Like this:
The snippet shows how to concat two arrays row-wise.
When you need column-wise you need to transpose them…
12-05-2022 07:10 AM
Hi GerdW,
Thank you for your quick prompt response. I will try to modify the code as you suggested.
Thank you.
Regards,
Arun
12-05-2022 10:36 AM
Hello, Arun. Glad that it is now working better.
I could easily have gotten the ordering mixed up in the final combination. Note that I assumed that the data coming in from the DAQ devices was organized so that the rows represent different A/D Channels, and the columns represent equally-spaced time samples of the data. I'll leave it to you to be sure the values are in the order you want.
A trick I find useful when dealing with such Array problems is to create a set of Dummy Arrays with unique values in all the cells. Combine them and see if the combination is correct. So Array A might be [A11 A12 (next row) A21 A22] and Array B would be similar. Now combine them, and see if "what you get is what you want".
How would you like to speed up your code by a factor of "a lot", and make it much more accurate? Do not do an FFT to estimate the height of a square wave. Take advantage of the fact that essentially all your data values are either +1 or -1 (scale as appropriate). Use a For Loop surrounding a Case Statement to separate the Positives from the Negatives and create two arrays, Positives and Negatives. Take the mean of each array and subtract them -- this gives you the amplitude without knowing (or caring, for that matter) anything about the sampling rate or the frequency of the square wave.
Bob Schor
01-08-2023 10:56 AM
Hi,
I would like to know how can I modify the code so as to generate a 64X64 matrix. The same circuit with 8 sensors. But now I have to move 8 horizontal steps at a single row position and 64 vertical steps too. By doing so there will be eight 64x8 matrix. Finally I have have to merge those to form a 64x64 matrix.
01-08-2023 11:00 AM
Here I am attaching the Sub VIs
01-08-2023 11:37 AM
Also, in this code, I am facing some issues while combining the two 16x8 matrices. I am attaching a model pic of the required combined matrix.
01-11-2023 09:49 AM
Hi Bob,
Did you notice my post?