07-14-2022 02:28 PM
Hi!
I am trying to build a microscope using the CNC shield with A4988 drivers. I would like to program the microscope to move between coordinates for time lapse experiments. At this point I can control the stepper motors with arrow keys and store the X and Y positions in an array (.vi attached), but I am struggling to use that array containing the coordinates to make a loop and move the motor between the points of interest. Please, could you help me with this?
Thank you so much in advance!
07-14-2022 07:44 PM
As a very first step you should go over the learning resource listed at the top if the forum. There are some seriously bad habits here.
I cannot run your VI because I don't have your instrument. Can you explain how it is to be used and what you expect.
07-14-2022 08:48 PM - edited 07-14-2022 08:49 PM
See if this can give you some ideas. You should probably do the playback differently, i.e. not to "hog" the event structure, but this should get you started.
07-18-2022 06:46 AM
Hey, thank you so much for all the comments! I am a beginner doing labview things and it is so valuable for me to have this kind of feedback.
As you suggested to me, I will check the learning resource listed at the top of the forum.
About the instrument, it is supposed that the stepper motor linked to the CNC shield will move pressing arrow keys and display coordinates in the screen, when I see something interesting in the microscope I would save the coordinates. Then when I have collected some coordinates I will run loop experiments moving the stepper motor automatically to reach the different saved positions taking pictures during a certain period of time (e.g. 1 hour).
Using the microscope.vi file, I can move the stepper motor pressing arrow keys.
But I can not make the stepper motor move automatically into a loop using the saved coordinates. I mean, if the current position is X1 = 200 and Y1 = 120 and the saved position in the array is X2 = 300 and Y2 = 400, so during the loop I am expecting the stepper motor will move automatically from X1 = 200 to X2 = 300, when X position is reached, do the same with Y1 to Y2, then when X = 300 and Y = 400 do a pause, take a picture and then go to the next saved position and do the same (e.g. X3 = 270 and Y3 = 300) for a certain period of time (e.g. 1 hour). Do you have some advice to do it?
I used the LED and the circle as a reference just to show how it is supposed that the microscope is moving through the sample, but you are right, I will consider a visual support more intuitive.
Thank you so much for the Microscope_MODCA.vi file, I think I have some ideas to work with!