06-09-2018 05:39 AM
Thank you all very much. I actually were able to simulate these rotating "lines" (moleculse) as I wanted. All I have left to do is to optimize my code, so it will be easier to read and obviously faster. I will make some of the corections you suggested. I attach my present code.
06-09-2018 06:30 AM
I applied some of your suggestions and I'll attach it here
06-09-2018 03:05 PM
@Silly_student wrote:
I applied some of your suggestions and I'll attach it here
Sigh!
OK, I got LabVIEW 2018 running on my laptop and I am now able to look at your code. Unfortunately, you have two missing subVIs so I can't even run it. Does it work?? (doubt it!)
Some important observations (that you have ignored in my earlier advice!)
I already mentioned your matrix initialization and you made it even worse! Now the outer output tunnel is "last value" so all earlier iterations are discarded. You are lucky that the "reshape matrix" will pad with zeroes. I have no idea why you think that you need to covert that matrix to a matrix using "array to matrix". Completely pointless. Does your current code produce the correct matrix based on size selection? If it is correct, here's a simpler alternative. (IF it is incorrect, please tell us how the matrix should look like! Other requirements can easily be equally simple) (Note that I eliminated the locals).
Again, you are not doing any linear algebra, so please keep it as a 2D array! Don't convert to a matrix! A matrix has a very special meaning in LabVIEW. It is basically a typedef'd 2D array that silently changes certain operations. Definitely not what you want here!
06-10-2018 03:02 PM
I must have attached the wrong code, because I already changed the initializing of the matrix. Even though I missuse the term of local variables, it is still better for me to use some, except wiring everything through the whole block diagramm. I think I stay with the matrix type of the angles, simply because it is working correctly now so I think there's no need in changing it. Still thank you very much for your time and help!!
06-10-2018 03:13 PM - edited 06-10-2018 03:24 PM
@Silly_student wrote:
I must have attached the wrong code, because I already changed the initializing of the matrix.
Please don't re-use filename when attaching new code. My downloads folder e.g. already has a "Draw_matrix.vi", so the newer version will be renamed to "Draw_matrix(1).vi" by the browser and the caller will only find the stale version. This is very annoying!
If you re-use filenames, Please place all files into a zip file before attaching so they can be unzipped to a new folder, limiting the problem somewhat (unless an older VI with the same name is still in memory). If you make it too complicated for us, nobody will help.
Even if you put the files into a zip archive, give them new names! Sometimes we want to compare old and new versions side-by-side and that's not possible if everything has the same name.