FAQ: What is the best way to correctly use the RETURN instruction? We had some issues in some cases when the Functions blocks get stuck, or needs an additional trigger.
Breadcrumb
Contact Us
contactUsAction
The RETURN causes the controller to stop executing code in a function or function block POU, and immediately go back to the POU that called the function. This is good for execution efficiency, but can cause problems if not used correctly. It's efficient because the code below the RETURN becomes dormant. (Not scanned)
Never allow the RETURN to execute if any code below the RETURN is still "Active." Active means an Execute input for a function block is high, or a function inside the function is "Busy," or an R_TRIG has a high input, basically any code that will become confused after "sleeping." For example, if a RETURN takes place while an MC_Move_Absolute.Execute is high, MC_MoveAbsolute will not notice when the execute logic goes low. Next time the function is executed, MC_MoveAbsolute will not notice the rising edge for execute, because to the MC_MoveAbsolute, it has always been high.
For examples, look at the code used in nearly all of Yaskawa's Toolbox functions. We use a technique that only allows the RETURN to take place if many conditions are met.
SAFETY PRECAUTIONS AND INSTRUCTIONS FOR USE OF FAQ INFORMATION!
Please read and understand the product instruction manual before installing, servicing or operating Yaskawa products. FAQ content and illustrations are provided as technical advice to augment the information in manual, not supersede it. It is not possible to give detailed instructions for all types of installation or support activities. The information described in the FAQs are subject to change without notice to improve the product or FAQ. Yaskawa assumes no responsibility for errors or omissions or damages resulting from the use of the information contained in any FAQ. All warnings, cautions and product instruction for product use must be followed. Installation, operation and maintenance should be carried out by qualified personnel. Failure to observe these and other precautions highlighted in the product manuals will expose the user to high voltages resulting in, serious injury or death. Qualified personnel are defined as individuals who are familiar with the installation, starting, operation and maintenance of Yaskawa products of the type described and have proper qualifications to perform the work.
Phone
If you have an urgent request, please call: 1-800-YASKAWA (927-5292) or 1-847-887-7000.Electronically
To contact us electronically, please select your type of request and complete the form.Yaskawa America, Inc. - Drives & Motion Division
2121 Norman Drive South
Waukegan, IL 60085