LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

detect limit switch reached/find min max position

Hi everyone!

 

I'm new to LabVIEW and I'm having a problem with the motion control stuff. My goal is to detect the minimum and maximum position of a device's axis with limit switches. The problem is, I don't know how to detect when a limit switch has been reached. My first attempt looked like this:

Endposition finden.png

This is a SubVI which I call twice (using a sequence), with directions 1 and -1, to find both ends. However, it doesn't always work. Sometimes it only finds one limit, although the axis is moving towards the other end. I guess this is because there is an error occuring during the wait operation. Also, I'm not certain whether "move complete" is the correct stop criterion here. I'd rather read some value telling me specifically that a limit switch has been hit. I tried using the error output, but it just tells me that there is no error, although sometimes it displays a message box telling me that the limit in the direction of travel has been reached. It also tells me that this is warning 70026. But that number doesn't appear anywhere else, particularly not in the error code where I could catch it programatically.


Currently I'm using a workaround as illustrated here:

But that isn't very reliable either. Sometimes the device goes crazy and sticks to one end and kind of thrusts against it over and over until I issue a stop command. I have no idea why that happens. By the way, my LabVIEW version is 6.x and the device is a Steinmeyer OFD with 4 axes which is connected via a 7344 controller. I hope I made clear what I'm trying to accomplish and am grateful for any help on that. Thanks in advance.

0 Kudos
Message 1 of 2
(2,853 Views)

Hi

it would be interesting to know which hardware do you use. It would also be helpful, if you post your VIs as code and not only as picture.

For the first few, i would recomend the following document:
http://zone.ni.com/devzone/cda/tut/p/id/3036
It describes how you can configure the limit switches in the MAX.

0 Kudos
Message 2 of 2
(2,812 Views)