Strom Posted January 9, 2012 Report Share Posted January 9, 2012 I am using a NI USB 6008 to control a 2 pole stepper motor. The driver I have is controlled via 4 digital outputs from the DAQ (ie: Step 1 AB, Step 2 BA*, Step 3 A*B*, etc). What I've done is out all 4 outputs for each step into a its own frame in a Timed loop (So in the 1st frame, aka step 1, 5V on A and B and 0V on A* and B* and so forth for all 4 steps), using the period of the Timed loop I can then control the speed at which the motor will turn & using the iterations, how far it will turn. My problem comes in that the Timed loop does nothing, when I run the VI nothing happens and when I check the number of iterations the loop has run though, the probe says 'not executed'. My knowledge of Labview comes mostly from my own messing around, so I'm sure its something simple I don't know, but I've looked through the examples in Labview and cant find anything that would change mine. My VI is attached below If anyone has any suggestions as to what could be causing this problem or a better way as to control the motor using the 4 digital outputs, just shout (Or if you need for info as to what/why/how I'm doing it). Thanks Motor Control.vi Quote Link to comment
drjdpowell Posted January 9, 2012 Report Share Posted January 9, 2012 (edited) Well, first, I’m assuming this is a learning project, rather than having motor control as the main purpose (if not, say so, because there are much better ways to control a stepper motor). I can’t run the code because I don’t have the 2011 DAQ stuff installed, but looking at you VI I see that you have cut-and-paste the complete code from a DAQ example several times into the outer timed loop 16 times. Because this example itself has a continuously-running loop in it, and doesn’t stop running until you hit its STOP button , the outer timed loop never finishes its first iteration, because the code inside it never finishes. You would be better off making a copy of a DAQ example VI and then try to modify it to suit your needs. There is probably an example that controls N lines for N samples at a specified rate; that one might be the best. Avoid loop-inside-loop until you have more experience, and learn to create a subVI as an alternative to multiple cut-and-paste. Hope this helps, — James BTW, these types of questions might be better posted on the NI.com LabVIEW board; many more potential respondents. Edited January 9, 2012 by drjdpowell Quote Link to comment
Strom Posted January 10, 2012 Author Report Share Posted January 10, 2012 Ah thanks, had to cut & paste because for some reason it wouldn't let me place some of the DAQ components, I think I see what you mean though, I'll remove those links and see what I can do Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.