08-18-2010 01:17 PM
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.
08-18-2010 01:20 PM
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?
08-18-2010 01:33 PM
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.
08-30-2010 01:54 PM
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
08-30-2010 02:47 PM
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?
08-30-2010 02:57 PM
I'm not sure how to set the homing parameters so after my track moves, it will move back to the home position?
08-30-2010 03:13 PM
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.
08-30-2010 04:30 PM
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).
08-30-2010 05:44 PM - edited 08-30-2010 05:46 PM
@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?
08-31-2010 12:59 PM
But how come after the track moves, it goes back to the original home position