Siemens (SINUMERIK) native measurement loop and Renishaw L98xx macro program programming and debugging guide

Document Number: RG-SI07-v3.0Compilation Unit: Technical Department of Ningbo Jiangce Technology Co., Ltd.Applicable Systems: SINUMERIK 828D/840D/840D SLCore Theme: Distinguish and master the dual-mod

Document Number: RG-SI07-v3.0
Compilation Unit: Technical Department of Ningbo Jiangce Technology Co., Ltd.
Applicable Systems: SINUMERIK 828D/840D/840D SL
Core Theme: Distinguish and master the dual-mode programming of Siemens system’s native measurement cycle (CYCL97x) and Renishaw Inspection Plus software package (L98xx), with 10 collision avoidance guidelines and result writing attached..

catalogue

  • Overview: Programming Philosophy Differences between Siemens Systems and Fanuc Systems
  • Siemens Native Measurement Cycle (CYCL97x) Architecture Detail
  • Renishaw Inspection Plus for Siemens (L98xx) Package Details
  • Result Returns and Global Variables (_oVR Array and GUD Variables)
  • Practical Comparison: Native Cycle and Renishaw-L98xx Code Routine
  • Debugging and Error Prevention: 10 Siemens On Machine Measurement Safety Avoiding Pits Guide
  • Common Fault Diagnosis and Technology FAQ
  • 1. Overview: Programming Philosophy Differences between Siemens Systems and Fanuc Systems

    In the field of On Machine Measurement (OMM), Fanuc and SINUMERIK systems represent two completely different underlying design concepts:

  • Fanuc system:All measurements are based on“Macro Program”development。Renishaw’s Inspection Plus The software package passed on Fanuc G65 P98xx Command to call O9xxx Series user subroutine,Parameters are addressed by English letters(D, Z, S, H 等)transmit。
  • Siemens system: equipped with a “dual track” measurement route.
    1. Siemens native measuring technology: directly embedded in the system kernel.. The Siemens system comes with a high-precision (taking the Renishaw OMP400 strain gauge probe as an example, the unidirectional repeatability accuracy can reach 0.25 µ m 2 σ at a touch speed of 50mm/240mm/min) and deeply integrated native measurement cycle, namely CYCLE971 to CYCLE998. When calling, it does not rely on any Renishaw macro program, and it is directly called from the NC system interface or NC code.
    2. Renishaw Inspection Plus software package (Siemens version): This is a set of independent measurement subroutines customized and developed by Renishaw for Siemens systems, usually named L98xx (such as L9810, L9812). Although its instructions and process are modeled after Fanuc, they exist as independent subroutines in the Siemens system.
    3. Industry technical vulnerability correction:
      In field applications or major CNC forums, many engineers and technical articles often confuse Siemens’ native loops (CYCLE977, CYCLE974, etc.) with the Renishaw software package, and even write non-existent false call instructions such asCYCLE9812.. This is extremely unprofessional. The native loop provided by Siemens is in the format of CYCL97x/CYCL98x; And Renishaw’s macro program on Siemens is alwaysL98xx(for example, L9812 corresponds to inner hole measurement, L9810 corresponds to safety positioning). The two cannot be mixed, and the variable mechanisms for parameter passing and result writing are also standardized.

      2. Detailed explanation of Siemens native measurement cycle (CYCL97x) architecture

      The Siemens native measurement loop is the core function provided by the SINUMERIK system, and its calculation logic is directly processed by the underlying Siemens system without the need for external loading of any macro program files. It has extremely high interpolation and data response speed.

      2.1 Definition of Core Native Measurement Cycle

      Native Loop Number Functional Definition Corresponding to the Koleos function Explanation
      CYCLE973 Single side calibration of workpiece probe O9801 / O9803 Calibrate the probe length or effective sphere radius on a known surface
      CYCLE974 Single point measurement (1-point measurement) O9811 Touch and calculate the positional deviation along the X, Y, or Z axis using a single-sided probe
      CYCLE976 3D calibration of the probe on the calibration ball/ring gauge O9801 / O9802 Calibrate the eccentricity constant of the measuring needle’s center and the 3D sphere radius
      CYCLE977 Workpiece centering measurement (Hole/Shaft/Pocket/Spigot) O9812 / O9814 / O9817 Native fast multi-point centering measurement of inner hole/outer circle/cavity/convex platform
      CYCLE978 Single side measurement of workpiece (with automatic tool repair update) O9811 Native support for directly accumulating measurement deviations and writing them into the specified tool wear
      CYCLE971 Tool Measurement Cycle O9851 / O9852 / O9853 Automatically measure the length, radial radius, and tool breakage detection of the tool on the tool setter

      2.2 Siemens native loop parameter transmission mechanism

      Siemens native loop parameters do not rely on macro program local variables, but instead rely on Siemens preset general variables or parameter lists passed directly.
      The calling format adopts the standard Siemens function format, such as:

      CYCLE977(S_MVAR, S_KNUM, S_PRNUM, S_SETVAL, S_FA, S_TSA, S_STA1, …)

      3. Detailed explanation of Renishaw Inspection Plus for Siemens (L98xx) software package

      When customers choose to install Renishaw’s official Inspection Plus on Siemens machining centers (usually to maintain consistency with Fanuc workshop programs, or to utilize Renishaw’s unique dual hole spacing, feature to feature, SupaTouch calibration algorithm), their subroutine collection will be loaded into the “Subroutines (SPF)” or “CUS.DIR (User Subroutines)” directory of the machine tool, and will be called using theL98xxformat.

      3.1 Core L98xx Subroutine Summary Table

      Zicheng serial number Corresponding name Function and Description
      L9810 Protected Position Move Perform fast knife movement with collision hard skip monitoring between two points. Stop the needle midway and sound the alarm.
      L9811 Single Surface Measurement Single point touch measurement, calculate the height of the workpiece in the single axis direction and calibrate the coordinate system.
      L9812 Bore/Pocket for inner hole/cavity centering Automatically measure the center position and measured diameter size of the inner circular hole and square groove at 4 o’clock.
      L9814 External cylinder/convex platform seeking center (Boss/Web) Find the center of the outer circle and square protrusions and rewrite the center point into the coordinate system with one click.
      L9815 3D Corner Measurement Automatically touch two intersecting surfaces and calculate their theoretical intersection points and angles.
      L9817 5-point rectangle touch test Measure square holes or convex platforms, including X/Y tilt angles and center finding.
      L9820 Workpiece Probe Calibration Perform geometric calibration on the workpiece probe on a high-precision calibration ring or standard block (mainstream brand tool presetters typically have one-way repeatability in the range of 0.4~1.0 µ m 2 σ).
      L9855 Tool Setter Calibration Calibrate the surface Z mechanical height and XY disc position deviation of the contact type tool setter.
      L9856 Tool Length Measurement Measure the measured absolute length of non rotating or rotating tools on the spindle and update the tool compensation.
      L9857 Tool Radius Measure Dynamically measure the radius of the milling cutter or the maximum outer diameter of the disc milling cutter during rotation.
      L9858 Tool Breakage Detection Quick online inspection for broken knives and damages, mandatory shutdown and alarm when exceeding the threshold setting value.

      3.2 L98xx macro call parameter assignment mechanism

      Under the Siemens system, the Renishaw L98xx software package adopts the following two flexible calling syntax:

    4. Parameter assignment call(Standard Siemens transmission)L9812 DI=80.0 ZZ=-10.0 S=1
      (among which DI Corresponding to Fanuc Dd parameter,ZZ correspond to Zz Depth,S Representing Writing 1 The coordinate system is G54)
    5. R variable value passing method (classic Renishaw Siemens method):
      Due to the fact that some early versions of Siemens do not support mixed transmission of English letter parameters, Renishaw also allows the use of specific R parameter blocks or the system’sO98XX []variable array to predefine parameters, and then directly writeL9812for air conditioning use..
    6. 4. Result feedback and global variables (‘OVR array and GUD variables)

      In terms of the feedback mechanism for measurement results, Siemens systems and Fanuc also have essential differences:

      4.1 System’s OvR array: Siemens and Renishaw’s universal interface

      Whether executing the Siemens native measurement loop (CYCL97x) or Renishaw’s L98xx subroutine, the measured and calculated results (such as measured dimensions, center offset, and deviation) are all written back and saved to the global system variable array within the Siemens system.

      Core Write Back Variable Mapping Table (Workpiece Measurement):

      System-OVR [] variable Corresponding Fanuc # variable physical meaning Remark
      _OVR[1] #138 Measurement of actual dimensions (inner diameter/outer diameter/width) Including machining tolerance verification
      _OVR[4] #135 Measured X-axis measurement center value Absolute mechanical coordinates/relative offset
      _OVR[5] #136 Measured Y-axis measurement center value Absolute coordinates of the second axis
      _OVR[6] #137 Actual measurement of Z-axis height value Z-axis height measurement results
      _OVR[16] #141 Actual size deviation (measured nominal) Used to determine whether there is a deviation and allocate knife compensation
      _OVR[20] #143 Y-axis measurement deviation value Position deviation in the Y-axis direction

      Debugging and automatic processing programs can perform logical control by directly reading the array, for example:

      IF (_OVR[16] > 0.05) GOTOF OVER_TOLERANCE ; If the deviation is greater than 0.05mm, it will jump to the abnormal knife repair processing

      4.2 Naming of Global User Data (GUD) and Preventing Duplicate Name Conflicts

      Under the Fanuc system,Renishaw utilizes #500#531 To store bias parameters。In Siemens system,Renishaw uses specialized GUD(Global User Data) variable library,A typical naming convention is O98XX[] Named array variables。This set of variables is PLC 与 NC Load static storage directly at startup(SRAM)中,It will also be permanently retained when the machine tool is powered off。

      5. Practical comparison: Native CYCLE and Renishaw L98xx code routines

      In order to enable on-site technicians and electrical engineers to fully understand the essential differences between the two, the following are respectively presented:Siemens native cycle (CYCL97x)andRenishaw Inspection Plus (L98xx)perform “protective positioning ->inner hole centering write back G54->on the machine tool; The complete NC program (MPF) for lifting the knife ->turning off the probe:

      5.1 Demonstration Program A: Using Siemens Native Measurement Cycle CYCL97x

      ; ================================================================
      ; tutorial A:SIEMENS_NATIVE_PROBE.MPF
      ; Applicable:SINUMERIK 828D / 840D sl Native measurement loop writing method
      ; ================================================================
      N10 G21 G90 G94 ; Unit and Absolute Coordinate Setting
      N20 T20 D1 ; Transfer in measurement probe 20 号,Activate D1 length compensation
      N30 G54 G0 X0. Y0. Z100. ; Positioned above the nominal inner hole due to carelessness,Z Axis safety height
      N40 STOPRE ; Interrupt system preview,Prevent triggering touch actions in advance

      ; — Steps 1: Activate the probe —
      N50 M19 ; Main axis orientation,Ensure that the eccentricity triggered by the probe can be compensated by the system constant
      N60 G0 Z25. ; Quickly cut the knife
      N70 G1 Z10. F1500 ; Slow down to feed plane

      ; — Steps 2: Native touch inner hole search and one click rewriting G54 (GUD Variable input) —
      ; S_MVAR = 920512 Representative:Multi point circular hole centering measurement,And rewrite the center into the current zero offset coordinate system
      ; S_SETVAL = 50.0 Representative:The nominal diameter is 50.0mm
      ; S_KNUM = 1 Representative:write 1 Number can set coordinate system(即 G54)
      ; S_TSA = 3 Representative:measurement depth Z = -5.0mm
      N80 CYCLE977(920512, 1, 1, 50.0, 10.0, -5.0, 0.0, 360.0, 4, 1, 1, 0.2, 0.0, 0.0, 0, 1)
      N90 STOPRE ; Interrupt pre reading

      ; —Step 3: Measurement, Calculation and Analysis –
      N100 IF (‘OVR [16]>0.03) GOTOF LIMIT_LARM; If the measured aperture is larger than 0.03mm, jump alarm

      ; — Steps 4: End knife lifting and safely reset —
      N110 G0 Z150. ; Quickly and safely lift the knife
      N120 M30 ; Program ends normally

      N130 LIMIT_ALARM:
      N140 MSG(“The aperture size exceeds the tolerance:The measured deviation has exceeded the threshold 0.03mm!”)
      N150 M0 ; Prompt and force pause
      N160 M30

      5.2 Demonstration Program B: Adopting Renishaw Inspection Plus for Siemens (L98xx)

      ; ================================================================
      ; tutorial B:RENISHAW_L98XX_PROBE.MPF
      ; Applicable:Installed official Renishaw Inspection Plus for Siemens Software package for machine tools
      ; ================================================================
      N10 G21 G90 G94 ; Security settings
      N20 T20 D1 ; transfer in 20 Renishaw probe and enable D1
      N30 G54 G0 X0. Y0. Z100. ; Locate to G54 above
      N40 L9832 ; Call Renishaw Official L9832 Subroutine opens probe signal

      ; —Step 1: Call L9810 protective positioning security down to a depth of Z-5mm —
      N50 L9810 Z-5.0 F3000; Diving at a speed of 3000mm/min, the entire process skips touch detection alarm protection

      ; — Steps 2: call L9812 Execution Standard 4 Precise centering of the inner hole —
      ; DI = 50.0 Representative:Nominal aperture 50.0mm
      ; ZZ = -5.0 Representative:Z Measure the current depth
      ; S = 1.0 Representative:After the measurement is completed X/Y Offset one click write back G54(1Number coordinate system)
      N60 L9812 DI=50.0 ZZ=-5.0 S=1.0
      N70 STOPRE ; Interrupt pre reading,Lock data into the system

      ; —Step 3: Read back the calculated deviation –
      N80 R50=_SVR [16]; Transfer the measured dimensional deviation (measured value nominal value) to the R50 variable
      N90 IF (R50>0.03) GOTOF VNet PROCESS

      ; — Steps 4: Lift the knife and close the probe —
      N100 G0 Z150. ; Lift to the absolute safe reference height
      N110 L9833 ; Call Renishaw Official L9833 Physically turn off the infrared signal of the probe
      N120 M30

      N130 ERROR_PROCESS:
      N140 MSG(“Renishaw warning:The measured aperture of the workpiece is too large,Current deviation:” << R50)
      N150 M0
      N160 M30

      6. Debugging and Error Prevention: 10 Siemens On Machine Measurement Safety Avoiding Pits Guidelines

      The control mechanism of Siemens system is extremely sensitive, and in machine measurement is extremely sensitive to the environment and variables. In order to reduce the failure rate of physical collisions (pins) and data drift on site, it is necessary to strictly follow the following 10 safety and error prevention guidelines during debugging:

    7. STOPRE interrupt system:
      Siemens has strong multi-stage Look Ahead capability.
      . Before and after executing any measurement loop (whether it is nativeCYCL97xorL98xx),must insert theSTOPREinstruction to interrupt the system preview! Otherwise, CNC may read the result variable before the measurement action is completed, or pre judge it as a trigger before the probe reaches the measurement depth, causing logical confusion and collision.
    8. It is absolutely forbidden to manually overwrite R100 to R249:
      Renishaw will temporarily read and write a large number of common variablesR100 to R249during Siemens’ low-level operations.
      . When writing CNC macro programs unrelated to measurement, such as chip removal, flushing, and four axis self-locking, do not occupy the R100 to R249 range! Otherwise, once the measured and calculated values are overwritten by the background, the probe will instantly lose the compensation for the center of the ball and the calibration height, causing the measuring needle to be directly broken at an extremely high height during the next tool touch measurement!
    9. High speed hard interrupt interface verification (DB option lock):
      Whether it is L9810 protected tool shifting or Siemens nativeCYCLE, its touch protection relies entirely on microsecond level hard interrupts of high-speed skip input (HSS).. Siemens must enable the “On Machine Measurement/Hard Interrupt Response Function Interface” system software option. If this option is not enabled, any measurement related toMEAS/MEAWwill not emit a feed brake signal when touched, and the probe will be crushed alive!
    10. Measurement ball material and high precision (taking Renishaw OMP400 strain gauge probe as an example, the unidirectional repeatability accuracy can reach 0.25 µ m 2 σ at a measuring speed of 50mm/240mm/min) Bottom layer principle analysis:
      The reason why on-site machine measurement can ensure the unidirectional repeatability positioning accuracy within2 μ mis based on Renishaw’s bottom layerprecision electrical contact structure principle (Kinematic resistive switch): the measuring needle connecting rod base is clamped on a conductive circuit composed of six precision tungsten carbide spherical contacts through three 120 ° conductive pins.. Once the measuring needle is subjected to a small contact force of0.1 μ m, it will cause one of the contacts to slightly separate, resulting in an instantaneous impedance jump of the closed circuit and a hard interruption. This structure is extremely sensitive to lateral tension, and it is important to avoid replacing non original and impedance calibrated sapphire measuring balls on site.
    11. Axis offset zero writing safety lock ($P_UIFR[ ] Protection)
      Running Renishaw L9812 Or native CYCLE 时,If the measurement parameters are configured to be written into the coordinate system(如 S1.0S_KNUM=1),After the touch test is completed, the system will automatically write it into the zero bias register of the system(如 $P_UIFR[1] correspond to G54)。During the automatic touch testing process,Absolutely not allowed to use with PLC Or manual operation of the control panel G10/MDI Forcefully modify the coordinate system,Strictly prevent the risk of secondary collision caused by data coverage。
    12. Main spindle mechanical strong positioning restriction (M19 synchronous response):
      Before performing hole measurement (L9812), cylinder measurement (L9814), or eccentricity calibration,the main spindle must be precisely locked in the same physical orientation (usually M19 directional locking)! If the PLC of the machine tool factory does not feed back the M19 orientation completion signal to the NC controller core of the system, even if the measurement command is called in the program, it will timeout during orientation waiting, or the 3D calibration eccentric data will be completely distorted due to the free rotation of the spindle, and the measurement results will drift.
    13. Under voltage of probe battery DB Signal correlation protection
      When the probe battery(如 Saft 1/2AA Lithium battery)When the voltage is below the system warning line,The intensity of infrared optical communication will instantly weaken。PLC It must be done in the background OMI-2 The receiver’s“Battery Low”Signal pins are associated with the system DB interface(If sent out PLC alarm 700025)。If forcibly executed,There may be sudden interruption of infrared signal during the process of measuring the knife,The system did not capture it G31 The signal triggers a direct insertion collision!
    14. Self purification delay for blowing air and chips (0.4MPa adjustment for air blowing):
      Before conducting touch testing on the workpiece and tool setter, it is necessary to ensure that the 0.4MPa air source works for 2-3 seconds to completely blow away the chips and emulsion at the contact area.. Due to the extremely high viscous resistance of emulsions, if not completely blown off, false or delayed triggering may occur during probe contact due to the presence of emulsion film, resulting in severe accuracy fluctuations of 10-15 μ m in measurement results.
    15. Rotation measurement must use spindle reversal:
      When performing tool dynamic radius detection (L9857), in order to prevent damage to the tool setter, the spindle must be reversed (M04).. If the M03 forward rotation is used incorrectly, the precision machining milling cutter and the sharp edge of the hard alloy will instantly contact the disc surface, causing the high-precision grinding disc type probe to scratch or gnaw off the disc!
    16. Anti collision “weak pull pin” protection measures:
      Renishaw contact type tool setter (such as TS27R/RTS) and the connecting rod root of the workpiece probe are both designed with dedicated “high toughness weak pull pin (Break stem)”.. When a serious mechanical impact occurs unexpectedly, the weak pull pin will automatically break first and absorb the collision energy, preventing the high-precision (Renishaw OTS optical tool setter with a repeat accuracy of 1.0 µ m 2 σ) optoelectronic body structure worth thousands of yuan from being scrapped. After the needle is broken on site, it is strictly prohibited to randomly find a stainless steel screw or high-strength iron pin to replace it! This will completely lose the secondary collision relief guarantee.
    17. 7. Common Fault Diagnosis and Technical FAQ

      Q: Why does the system prompt “array overflow or variable definition does not exist” when using L9812 to measure circular holes on Siemens HMI?
      A: This is usually because the machine tool has not declared Renishaw’s global variable array in the system static data (SRAM) (mainly due to missing or unloaded array definitions inO98XX []). It is necessary to copy the definition files from the Renishaw installation disk (such asN_GUD9_deF) into the user-defined area of the CNC system and perform a “Start (SBL)” reset or machine restart to ensure that the system variables are ready.

      Q: How to cooperate with Renishaw infrared receiver box to achieve signal distribution when there are dual spindles on the same five axis linkage gantry equipment?
      A: Renishaw’sMultiple Probe System technology can be used.. Use RMI-Q radio receiver with multi-channel coding pairing function. Two probes are registered on the same RMI-Q. In the PLC program, based on the tool change ready signal of the Z-axis spindle A or spindle B currently being processed, the high and low level control RMI-Q is sent through the output control line of the PLC to switch and lock the probe, thus achieving physical isolation and communication security of infrared/RF signals.

      Copyright Notice: This document was originally compiled and published by the Technical Department of Ningbo Jiangce Technology Co., Ltd. It aims to provide the most in-depth and practical measurement technology support for equipment maintenance technicians and electrical debuggers in the field of precision machining.

      Disclaimer: All Siemens system instructions (CYCL973~978, etc.) and Renishaw macro programs (L9810/L9811/L9812) mentioned in this article are aligned with Siemens’ official SINUMERIK Measurement Cycle Manual and Renishaw’s on-site debugging standards. Before actual testing on the machine, please make sure to perform single-stage low-speed debugging and conduct sufficient collision avoidance verification.

      Supplementary Q&A

      Q: How to choose between Siemens CYCLE native measurement cycle and Renishaw L98xx macro program on Siemens system?
      Answer: There is no absolute superiority or inferiority. The Cycle cycle is built-in to Siemens, requiring no additional loading, and has a user-friendly parameter interface, making it suitable for standard measurement tasks. The L98xx macro program is a proprietary package from Renishaw, providing richer measurement strategies such as multi-point angle measurement and automatic compensation writing, suitable for scenarios that require deep customization. In reality, many machine tools on site are equipped with two sets, and can be flexibly selected according to the task.

      Q: Will the calibration data of both the CYCLE loop and L98xx macro program installed on the Siemens system conflict?
      Answer: There will be no conflict. The calibration data for the CYCLE loop is stored in Siemens system variables (written through CYCL976), while the calibration data for the L98xx macro program is stored in Renishaw’s GUD9 global variables (such as the O’98XX array). Two sets of data are completely independent, each maintaining its own space. After changing the measuring needle, both sets need to be recalibrated, and it cannot be assumed that labeling L98xx is equivalent to labeling CYCLE.

      Related Reading

    18. <a href=" https://jcetech.cn/scene-config-nav/ CNC machine internal measurement configuration scheme: Processing scenario x brand– View all brand recommended schemes by processing scenario
    19. <a href=" https://jcetech.cn/siemens-probe-programming/ Siemens SINUMERIK System Probe and Tool Measurement Programming Guide
    20. <a href=" https://jcetech.cn/inspection-plus-program-fanuc-meldas/ Inspection Plus Macro Programming Guide (Fanuc/Moldas Chapter)
    21. <a href=" https://jcetech.cn/fanuc-probe-programming/ Fanuc System Probe and Tool Alignment Programming Guide
    22. Official Appointment:jcetech.cn/contact
      Consultation Hotline: 157-5780-7400/132-2194-1413
      Shipping address: A2-12B17, Yinzhou R&D Park, Ningbo