Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enable or disable the limits of a single axis, programmatically?

I am trying to enable/disable the limits of a single axis, programmatically.  The Enable Limits.flx VI is not sufficient, because it only provides the ability to enable/disable all axes at the same time -- not just one.  I cannot find any way to do this -- I've even looked in the FlexMotion DLL to see if there is a function.  I need to do this, because there are instances where an axis moves into a limit switch and the only way to get off of the switch is to disable the limit (otherwise an error results when calling the move function).  However, I only want to change the enabled status of one axis -- not all axes.  The software routine that is operating on the axis in question has no knowledge of the states of the other axes.

Thanks,
0 Kudos
Message 1 of 5
(4,693 Views)
Jim,
  1. Enable Limits.flx does provide inputs to enable or disable limits for each axis seperately (see screenshot).
  2. When a limit switch is hit it's always possible to start a move into the direction away from the limit switch (e. g. if the fwd limit switch is active you can move the axis to the reverse direction). If this doesn't work for you please check if the limit switches are connected correctly (fwd switch to fwd input, rev switch to rev input).
I hope that helps,

Jochen Klier
National Instruments Germany



Message Edited by Jochen on 11-09-2006 09:13 AM

0 Kudos
Message 2 of 5
(4,689 Views)
Jochen,

Regarding #1, What I mean is that with Enable Limits.flx, one cannot set the enable/disable limits of a single axis without affecting the other axes.  Let's assume that I don't want to change the settings of the other axes, nor do I know what states that are currently in or are supposed to be in. 
Enable Limits.flx requires you to set the limit settings of all the axes -- this is not what I want.

Regarding #2, I do not think that this is the case.  I have tested it, and if the forward switch is active and I try to move in the reverse direction, I cannot do so.  The hardware is wired correctly.

For the moment, please just assume that my assertion in #2 is correct.  Let's focus on #1 -- it is very important to be able to do this.

Another option -- Is there any way to read the limits enabled/disabled status?  If there is, then I could just read the setting for all eight axes, modify the axis of interest, and call
Enable Limits.flx to write the setting for all eight axes (like a masked write operation).  However, I cannot find any way to read the limits enabled/disabled status.

Thank you for your help,
0 Kudos
Message 3 of 5
(4,676 Views)
Jochen,

I was able to find the answer.  There is a VI in the Advanced >> Write palette called Write Motion IO Data.vi which allows one to enable or disable a limit of a single axis (as well as other settings).

Thanks,


Message Edited by Jim Kring on 11-09-2006 02:02 PM

Message 4 of 5
(4,664 Views)
Jim,

initially I didn't understand exactly what you were looking for but yes, this is a good way to do what you want. Still it shouldn't be necessary.

Here are the results from a little test.
In this test the reverse limit switch is active but a move to the forward direction is allowed.



When I try to start a move to the reverse direction I get an error message:
Error -70119 (NIMC_limitSwitchActiveError) occurred in Start on Axis 1.
The desired move cannot be completed because the limit input is active in the direction ov travel



That's the way how limit switches are intended to work. I'm using NI-Motion 7.4 but I'm not aware of a bug in another version of NI-Motion that has an impact to this functionality.

Best regards,

Jochen

Message Edited by Jochen on 11-10-2006 08:46 AM

Download All
0 Kudos
Message 5 of 5
(4,657 Views)