FAQ: How does an SMC controller handle data which exceeds (or rolls over) the maximum value limit?
Breadcrumb
Contact Us
contactUsAction
Many programmers are concerned with overflow and what effect rollover will have on their addition and subtraction calculations.
The SMC controller uses "two's compliment" math which handles rollover with no special programming. This applies to add interal status variables and user variables.
To test this, Yaskawa has developed an example program that will perform a mathematical subtraction before, during, and after the rollover point. This makes calculating the difference between two numbers very easy, even when one grows past the maximum value. VAR1 and VAR2 are set to different very high numbers in the #TEST routine. The program then loops, the variables are compared, and the results are displayed. The variables are then incremented by 100,000.
#TEST
VAR1=2147483647-1000055
VAR2=2147483647-500055
#LOOP
VAR3=VAR2-VAR1
MG "VAR1= ",VAR1," VAR2= ",VAR2," DIFF= ",VAR3
VAR1=VAR1+100000
VAR2=VAR2+100000
WT50
JP #LOOP
Run this program on a SMC controller (using YTerm) and watch the terminal window for the values. After a few seconds, the variables will roll over, but the result of the subtraction will always be the same. Type "AB" in the terminal window to abort the program.
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