10-27-2014 11:41 AM
Hello,
I am using LabView to control two ThorLabs stepper motors and stages. My code moves them automatically with no user input after you press run. Now I would like to make a graph the graphs points of the position as the two motors move along there route. They stop at designated points along the route, which are the points I want to graph. One motor is an x axis and one motor is a y axis so I thought it wouldn't be too hard but I can't figure it out.
Thanks!
10-27-2014 12:24 PM
10-27-2014 03:14 PM
Indeed - when you hit a stopping point, simply append a cluster of the current {X | Y} to an array, and pass the array to an X-Y Graph.
If you want to get fancier, limit the array to the last 50 points (for example). Then your old history dies off.
If you want to get fancier, set the color of each point to be a dimmer shade of white. Then the old history fades away.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
11-12-2014 01:19 PM
The problem I am having is colecting the points, and updating the array and graph with new points as the code runs and the motor stops along is designated path. How do you go about doing this?
11-12-2014 02:00 PM
presumably your program is sending a command to a motor driver somewhere. Whether that is discrete pulses or a pulsetrain or a serial command to a smart motor, you should know when it is being told to move. Append your current position to the X-Y array of data points with and refresh (write to) the XY graph every time you send a command to move.
What architecture are you using? If you have multiple loops (e.g. motor control and UI) you may need to communicate between them to get the graph to update. Is that the issue?
11-12-2014 03:13 PM
@winterfresh11 wrote:
The problem I am having is colecting the points, and updating the array and graph with new points as the code runs and the motor stops along is designated path. How do you go about doing this?
There are almost as many ways as there are programmers. If you want specific help on your particular method, post your code so we know what you're trying to do...