<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
Copyright (c) 2006 UGS Corp.

All Rights Reserved.

This software and related documentation are proprietary to UGS Corp.
-->
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>S&amp;V Commands for Advanced Programming - Overview</title>
      <script language="javaScript">
        abridged="false";
        displayConditions=new Array();
      </script>
      <link type="text/css" href="../css/main_styles.css" rel="stylesheet">
   </head>
   <body class="bodydocs" onload="top.pageLoader()" bgcolor="#FFFFFF">
      <div class="title_topic3" id="xps10_pagetitle">S&amp;V Commands for Advanced Programming - Overview</div>
      <hr noshade="true">
      <p class="para_topic">Some simulation commands are specific to Advanced Programming and are needed for the machine tool driver.</p>
      <p class="para_topic">Certain machine information needs to be passed to the ISV system by means of global TCL variables. You need to set these variables in the MTD TCL script outside any procedure.</p>
      <div class="title_division">Global Variables</div>
      <div class="title_division">global mom_sim_pocket_working_transformation</div>
      <p class="para_division">This &nbsp;array describes the transformation (basically, a set of axes values) that transforms the pocket to its working position. This is the position in which a mounted tool can cut. Linear axis values are not of interest because the transformation only needs to specify the orientation of the tool within the lathe work plane. This transformation is evaluated within NX CAM for the following purpose:</p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Transformation of tool parameters such as orientation angle, and tracking point.</p>
         </li>
         <li>
            <p class="para_item">Mounting of non-library tools to the pocket &nbsp;</p>
         </li>
      </ol>
      <table cellspacing="3" width="100%" align="center">
         <tr valign="top">
            <th bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_th">Syntax</p>
            </th>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">set sim_pocket_working_transformation(turret_id@pocket_id) &quot;AXIS=&lt;axis_name_1&gt; VALUE=&lt;value_1&gt;,AXIS=&lt;axis_name_2&gt; VALUE=&lt;value_2&gt;,....&quot; </p>
               <p class="para_td">For many machines you only need to specify the turret rotational axis and the angle by which the turret needs to be rotated to bring the pocket into its working position. &nbsp;</p>
            </td>
         </tr>
         <tr valign="top">
            <th bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_th">Example</p>
            </th>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"># &nbsp;pocket angles turret 1</p>
               <p class="para_td">set mom_sim_pocket_working_transformation(1@1) &nbsp;&quot;AXIS=&lt;TURRET1&gt; VALUE=&lt;0&gt;&quot; </p>
               <p class="para_td">set mom_sim_pocket_working_transformation(1@2) &nbsp;&quot;AXIS=&lt;TURRET1&gt; VALUE=&lt;30&gt;&quot; </p>
               <p class="para_td"># &nbsp;pocket angles turret 2</p>
               <p class="para_td">set mom_sim_pocket_working_transformation(2@1) &nbsp;&quot;AXIS=&lt;TURRET2&gt; VALUE=&lt;0&gt;&quot; </p>
               <p class="para_td">set mom_sim_pocket_working_transformation(2@2) &nbsp;&quot;AXIS=&lt;TURRET2&gt; VALUE=&lt;30&gt;&quot; </p>
            </td>
         </tr>
      </table><br><table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/note.gif" alt="Note" title="Note"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_note">
                  <p class="para_note_body"> If the mom_sim_pocket_working_transformation array is not specified, the system tries to calculate the angles automatically. It calculates that rotation angle of the turret that brings the mounting junction origin of the tool pocket into the lathe work plane. In the common case where you just have one turret rotational axis which is parallel to the lathe spindle rotational axis, this calculation should be correct and you do not need to specify the above array in the MTD. You can look at the angle(s) used internally using the right mouse button menu entry <b class="uiTerm">Information</b> on the pocket node in the <b class="uiTerm">Machine Tool View</b>.
                  </p>
               </div>
            </td>
         </tr>
      </table>
      <table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/note.gif" alt="Note" title="Note"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_note">
                  <p class="para_note_body"><b class="uiTerm">CSE</b> model: The angle for a tool pocket can be specified in the <b class="uiTerm">Device Holder Data</b> dialog box of the Machine Tool Builder application. The software will use the angle from the dialog box if it is specified. Otherwise, the software will use the angle from the array above.
                  </p>
               </div>
            </td>
         </tr>
      </table>
      <div class="title_division">Initialization Commands</div>
      <p class="para_division">All functions that are prefixed SIM_mach initialize or provide general machine information required by the time calculation. You can only call these SIM_mach functions in the MOM_SIM_initialize_mtd procedure. They must not be called in any actual MOM event.</p>
      <p class="para_division">The following are the initialization commands. For a more complete description, follow the hyperlink.</p>
      <table cellspacing="3" width="100%" align="center">
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_mach_max_axis_rapid_velocity');return(false);">SIM_mach_max_axis_rapid_velocity</a> 
               </p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">sets the maximum rapid velocity for a machine axis.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_mach_max_spindle_speed');return(false);">SIM_mach_max_spindle_speed</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">sets the maximum spindle speed in rotations per minute (rpm) for the specified spindle. </p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_mach_assign_channel_to_spindle');return(false);">SIM_mach_assign_channel_to_spindle</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">tells the specified channel to work at the specified spindle.</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_mach_assign_axis_to_channel');return(false);">SIM_mach_assign_axis_to_channel</a></p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">the specified channel controls the specified axis</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_mach_default_primary_channel');return(false);">SIM_mach_default_primary_channel</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">specifies the default primary.</p>
            </td>
         </tr>
      </table><br><div class="title_division">Commands while Simulating</div>
      <table cellspacing="3" width="100%" align="center">
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_assign_channel_to_spindle');return(false);">SIM_assign_channel_to_spindle</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Tells the specified channel to work at the specified spindle.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_set_machining_mode');return(false);">SIM_set_machining_mode</a> 
               </p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Sets the machining mode for the current channel. </p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_synchronize');return(false);">SIM_synchronize</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Sets a synchronization mark for the current channel.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_primary_channel');return(false);">SIM_primary_channel</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Specifies the primary channel. This channel controls spindle speed.</p>
            </td>
         </tr>
         <tr>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td"><a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_set_axis_rapid_velocity');return(false);">SIM_set_axis_rapid_velocity</a></p>
            </td>
            <td bgcolor="#F4F4F4" colspan="1" rowspan="1" valign="top">
               <p class="para_td">Overwrites the setting of the function SIM_mach_max_axis_rapid_velocity</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_set_spindle_speed');return(false);">SIM_set_spindle_speed</a> 
               </p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Sets the spindle speed for the current channel. </p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_set_max_spindle_speed');return(false);">SIM_set_max_spindle_speed</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Sets the &nbsp;spindle speed upper limit &nbsp;for the current channel. </p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_set_surface_speed');return(false);">SIM_set_surface_speed</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Sets the surface speed for the current channel. </p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_delay');return(false);">SIM_delay</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Sets a dwell time for the current channel. </p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_load_workpiece');return(false);">SIM_load_workpiece</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Makes the current state of the workpiece visible in Turning simulations. </p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_unload_workpiece');return(false);">SIM_unload_workpiece</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">Removes the workpiece from the screen and from the kinematics model. </p>
            </td>
         </tr>
      </table><br><div class="title_division">Advanced Commands</div>
      <p class="para_division">The following commands are not necessarily needed and only for special cases and experienced MTD writers:</p>
      <table cellspacing="3" width="100%" align="center">
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_set_channel');return(false);">SIM_set_channel</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">sets the current channel. </p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_set_xtp_event');return(false);">SIM_set_xtp_event</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">passes the current xtp event to the time calculation.</p>
            </td>
         </tr>
         <tr valign="top">
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td"> <a class="links" href="javascript:void(0)" onclick="top.openFile('mfgisv/mfgisv_setup_ml_coms.html#SIM_reset_buffer');return(false);">SIM_reset_buffer</a></p>
            </td>
            <td bgcolor="#f4f4f4" colspan="1" rowspan="1">
               <p class="para_td">removes all information &nbsp;from the simulation input buffer. </p>
            </td>
         </tr>
      </table><br></body>
</html>