Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enable/disable limits and home inputs independently without affecting other axes

I have an object oriented VB program that has an axis object for each axis. Each axis doesn't know about the others. I want to enable/disable the limits and home sensors independently without an axis to have knowledge of what another axis setting are. I can't find a function that will let me read the current mask and allow me to AND/OR in just the values for one axis. That would be ideal. In looking at the flex_anable_limits call, I have to write the mask for all four axes at the same time. Any help would be greatly appreciated.
0 Kudos
Message 1 of 3
(3,594 Views)
Hello spcmicro,

I am making the assumption that you are using the FlexMotion driver.

At this time, the Limit Enable status is a write only parameter.
- The Limit Enable is traditionally an initialization step, and modifing it during the travel is not a common practice.
- In your case, you are trying to update the status of a limit without modifing the other axes. If it is to get a greater travel distance, I would recommend you look at using the Software Limits (instead of Hardware Limits).
- Otherwise, to know the current state of the limit enables, you will need to keep track of them in you code from the beginning. Since most of the configuration for the Motion Controller is in MAX, you will need to know the setup in MAX or re-configure it at the start of
your program. Once you have it, you can modify it as necessary.

Alan Hagler
0 Kudos
Message 2 of 3
(3,594 Views)
Thanks for the response. I am only writing to the registers once per axis on startup. The objects I've created, that initialize each axis, have no knowledge of each others settings. I ended up using a global variable, which is not really what I wanted to do. I think National designers made the assumption that the software calling these functions have knowledge about all of the axes that are on a board. I think there are 2 ways they could make this better:

1. Make the registers read/write, so that you could just read the other bits, and/or the bit for the desired axis, and write the value back. This is the easiest fix.

2. Have a single function that sets multiple parameters for a single axis, like limits, home sensors, etc...

I've worked around it, but
it forced me to compromise my object oriented design.
0 Kudos
Message 3 of 3
(3,594 Views)