Dan,
You can use the flex_read_axis_status_rtn function to check the status of the limit switches. Let me know if you need more details on how to use it.
Best Regards,
Michael Halloran
Systems Engineer
Viewpoint Systems - Boston Office
www.viewpointusa.com