01-20-2017 02:44 AM - edited 01-20-2017 02:46 AM
I mentioned this in my other topic, but since the question is kind of different I am creating a new one. If it's not okay, then please move it to the previous one.
So I build this imaging program, which scans the needed area column by column and saves the data to an array which is displayed as an intensity graph and also saves to a file after the program is done.
The problem is when the whole scan is finished, I can see a bottom of the whole array is cut off and moved to the top of the picture:
My program should work like this:
You manually find a spot where the signal is the strongest, then you run the program. It says, that the spot of the strongest signal is the center of the square, moves a detector to an upper left corner of the square and a little bit outside(done by subVi called Homing) of it and then scans the area like this:
Green arrow is performed in the first loop, the scan is performed at the beginning of every red arrow(second loop), then last subVi brings everything back to start and moves to another column. I double-checked everything and still can not find the issue here...
01-22-2017 10:19 AM
By using a few Style Rules (and almost always following them), you will possibly solve a lot of your problems yourself.
I started to look at your code, but found I didn't understand what you were doing nor how you were doing it. As it happened, I started with Homing, which I rewrote and have attached. The following are some Style Rules you should follow:
If you make your code more transparent, not only will others be able to better understand it (and help you find the bugs), but you will be able to follow your logic (which you presumably know much better than we do) and can have that famous "Aha!" moment when you see your own mistake. [One possibility is that you don't wire all of the inputs to Homing -- did you mean to do that?]
Bob Schor
01-24-2017 04:29 AM
So yesterday I took my time to clean my code a little bit according to your recommendations, I ended up with this:It was, in fact, easier to follow my code right now and still I ended up with nothing-no error in my code causing the whole image to shift. Still I was lucky enough to find that the problem was in the analyzer-somehow it managed to load a buffer with more than one response leading to all of data being shifted by about 10 iterations, so the lower part of the image was being acquired later, when the detector was already at the top. So, I guess problem is solved for now 🙂 Thanks for your advices about cleaning my code!