09-01-2010 03:20 PM
It doesn't make sense for one of the axis to move back and the other doesn't
09-13-2010 12:38 PM
If you look at my attachment I can get my axis to move, and then after they're done moving they move back to their original position. What I want, is for the "Y-axis" track to move from the sensor by the motor to the far end of the axis by the further sensor, once it reaches the far end it stops, then the "X-axis" track moves up one postion, then the "Y-axis" track moves back down toward the motor, and so forth. I want this to work many times. I have attached a copy of my code to see what I have completed so far.
09-13-2010 12:56 PM
I'm not sure how much of this is a LabVIEW question versus a question of how to program the 6k4. You should spend some time making it do what you want manually within the motion wizard (or hypterterminal), then move those commands into LabVIEW.
Would it be possible for you to provide a simple diagram of your setup? "Sensor by the motor" doesn't mean a lot to me.
I still don't understand exactly what you're trying to do nor what isn't working, but I suspect part of your problem is that you do not wait for motion to complete before sending the next command, and the 6k4 may not accept a new command for an axis that is already in motion.
Not that it matters, but you're setting a lot of settings that aren't necessary. There's no need to set HOMV, HOMVF, etc since you never use the HOM command. There's no reason to set MA, A, AA, etc every time through both for loops since they never change; just set them once at startup.
09-13-2010 01:49 PM
I'll fix those extra lines, I attached a picture of what I want the movement to be like, I had to draw it in paint, so I did my best.
09-13-2010 03:03 PM
If I'm understanding correctly, you want to run the Y axis back and forth between the two sensors. Each time it reaches one end, move the X axis a short distance.
I don't see how this relates to your current code, where you set the same distance for both the X and Y axis. Try writing the entire function in the 6k4 language, which will give you more control over the axis movement.
09-13-2010 03:08 PM
Well i'm using the looping to move it a certain amount of times, depending on how many times the user enters. The problem is in the Y-axis loop after it moves forward how can i get it to move backwards in those 2 loops that I have, because once i get that, I'm pretty sure it should be done. And, I am using the 6k language because it's the same language that Motion Planner uses, just implemented in labview.
09-13-2010 03:58 PM
I think you're misunderstanding me. You can write functions and programs in the 6k language, including loops that check the state of motion, which you cannot do easily (nor as fast) in LabVIEW. For example, you might set the Y axis to run in continuous mode and enable the end-of-travel sensors. Start moving the Y axis in one direction and it will stop when it hits the sensor. If you write a program to do this on the 6k, you can have it loop continuously (or wait) until the Y axis stops moving, then move the X axis. You could store the current direction of Y travel in a variable on the 6k and invert it each time you run your Y move function.
With your current approach, you will need a shift register in the for loops to track the current Y travel direction, and then send a different command (format into string may be useful for this) depending whether you need to move the Y axis forward or backward.
Have you successfully made the motors follow the pattern you want by entering commands directly into Motion Planner? If so, what are the commands you entered into Motion Planner to do the move sequence?
09-13-2010 04:33 PM
Well, the thing is I have to use labview, because the machine that is going to be connected to the tracks was programmed in labview, so once I can get these tracks to move the way I want them to in labview, I can combine the two programs so while the tracks move measurements of magnitude and phase are being taken.
09-13-2010 04:35 PM
You can write and store a program in the 6k, then call it from LabVIEW.
09-13-2010 04:38 PM
But its possible to make the movements that I want using LabVIEW or 6k right?