LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Computmotor 6K Motion Controller LabView program

It doesn't make sense for one of the axis to move back and the other doesn't 

0 Kudos
Message 31 of 43
(1,244 Views)

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. 

0 Kudos
Message 32 of 43
(1,222 Views)

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.

0 Kudos
Message 33 of 43
(1,215 Views)

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.

0 Kudos
Message 34 of 43
(1,209 Views)

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.

0 Kudos
Message 35 of 43
(1,184 Views)

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. 

0 Kudos
Message 36 of 43
(1,180 Views)

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?

0 Kudos
Message 37 of 43
(1,166 Views)

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. 

0 Kudos
Message 38 of 43
(1,159 Views)

You can write and store a program in the 6k, then call it from LabVIEW.

0 Kudos
Message 39 of 43
(1,155 Views)

But its possible to make the movements that I want using LabVIEW or 6k right? 

0 Kudos
Message 40 of 43
(1,152 Views)