FAQ: Is it possible to calculate the scan time of the program running in the SMC?
Breadcrumb
Contact Us
contactUsAction
Yes. There is a keyword in the system called "TIME" which counts the number of milliseconds (servo cycles) since the power was turned on or the system was reset.
Examine the following program:
#TEST
START=0
#LOOP
SB4
X=X*5
Y=4/2
Z=X*Y
CB4
SCAN=TIME-START
START=TIME
JP #LOOP
The value of SCAN will be updated to reflect the number of milliseconds since teh user variable START was last assigned.
TIME is in servo cycles, which by default is milliseconds. If the TM command is changed, TIME will change accordingly. If the TM parameter is reduced by half, the SCAN value will be twice as much. Below is an example that will take into account any TM value so SCAN will always be in milliseconds.
#TEST
START=0
#LOOP
SB4
X=X*5
Y=4/2
Z=X*Y
CB4
SCAN=(TIME-START) * (_TM/1024)
// MG SCAN
START=TIME
JP #LOOP
If you print the value of SCAN from a small program loop, the process of displaying the message (MG SCAN) may take a considerable amount of the actual program loop, resulting in erroneously larger program scan times. Processing characters for the serial port is very show compared to program execution speed. It is recommended to use the LV command or type MG SCAN when the scan value is needed.
If there are trip point commands in the program loop, they of course may add time to the loop based on the trip point delay period.
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