LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Computmotor 6K Motion Controller LabView program

You should be using the VISA Write function to write to the serial port, and you can send multiple lines of code in the same write.

0 Kudos
Message 11 of 43
(1,741 Views)

Can you check my code, I translated it word for word from Motion Planner. On Motion Planner it runs, but in LabVIEW it's not running I don't know why this is occuring? 

0 Kudos
Message 12 of 43
(1,739 Views)

You need to send a newline after every command.  You can include the newline in the string constant, just go to the end of the string and hit "Enter".  You may want to combine all the string constants into one (or two - one for setup, one for motion) and write all the command together.

0 Kudos
Message 13 of 43
(1,730 Views)

I can get the tracks to move and when I move the tracks in a positive distance (away from the motor) after it is done moving it will go back to HOME. When I move it in a negative distance(towards the motor) the tracks will always move back to the limit and then go back to HOME, although I'm not telling it to go to the limit. Is there a way I can fix this issue? Thank You. 

 

I have attached my code

0 Kudos
Message 14 of 43
(1,688 Views)

Are you asking about the homing operation at the end of your program?  HOM1 runs in the negative direction.  If you move past the home sensor in the negative direction and then execute HOM1, it will continue running in the negative direction until it hits the limit, then reverse direction until it finds the home sensor.  That's how homing works.  In many applications, you home the motor at the beginning to establish the zero position.  To move directly back to that home position at the end of the program, you execute an absolute move to 0.

 

Two minor comments: 1) you don't need a blank line after every command, you just need to put each command on a separate line, with one blank line at the end, and 2) why are you setting homing parameters at the end of the program after you start the homing operation?

0 Kudos
Message 15 of 43
(1,679 Views)

I'm not sure how to set the homing parameters so after my track moves, it will move back to the home position?

0 Kudos
Message 16 of 43
(1,673 Views)

Am I correctly understanding that after every sequence of moves, you want it to return to the home position by the most direct route?  You never tell the system what the home position is in the first place, so it can't know which direction it needs to move to find that home position.  If you don't like watching the motor run to one end of travel and then back to find the home position, you could try homing to an end-of-travel limit instead, so you always run the same direction to find the home position.

0 Kudos
Message 17 of 43
(1,661 Views)

I'm sorry but I don't quite understand. After the movement of the track I want it to go back to the home position no matter which way it travels(whether in the positive or negative direction). 

0 Kudos
Message 18 of 43
(1,651 Views)

@arthur51189 wrote:

I'm sorry but I don't quite understand. After the movement of the track I want it to go back to the home position no matter which way it travels(whether in the positive or negative direction). 


Isn't that what it's doing now, except with a detour through the end-of-travel limit when it has already passed the home sensor in the negative direction?  I think you may be misunderstanding the HOM command.  It doesn't go to the home position, it finds the home position, as shown in this (sloppy) picture.  You're telling it to find the home position starting in the negative direction and that's what it's doing.  It sounds like what you want it to do is to move towards the home in the positive direction if that would be shorter.  In order for that to happen, the system would need to know where the home sensor is before it started homing, and if it knew that, why would you run the home procedure at all?

22739iD8D07F0E0EE407FD

Message 19 of 43
(1,637 Views)

But how come after the track moves, it goes back to the original home position 

0 Kudos
Message 20 of 43
(1,615 Views)