<!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>User Defined Event Structure Definition</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">User Defined Event Structure Definition</div>
      <hr noshade="true">
      <p class="para_topic">Within the UDE file, the User Defined Events are defined using the following language syntax: </p><pre class="indent">EVENT &lt;name&gt;
{ 
POST_EVENT &lt;post_name&gt;
UI_LABEL &lt;ui_name&gt;
CATEGORY Mill | Drill | Lathe | WEDM [ Mill | Drill | Lathe | WEDM] [Mill | Drill | Lathe | WEDM] [ Mill | Drill | Lathe | WEDM] 
PARAM &lt;param_name_1&gt; 
{ 
TYPE i | d | s | o | b | p | v
DEFVAL &lt;default value as string&gt; 
TOGGLE Off | On 
OPTIONS &lt;string1, string2, string3....... &gt;
UI_LABEL &lt;ui_name&gt;
} 
PARAM &lt;param_name_2&gt;
{

} 
PARAM &lt;param_name_3&gt;
{

}
} </pre><p class="para_topic">All the words appearing in uppercase are keywords, as understood by the language. An EVENT can have many PARAM's and the description of all the attributes are as follows:</p>
      <ul>
         <li>
            <p class="para_item">EVENT &lt;name&gt; defines the event of name &quot;name&quot; </p>
         </li>
         <li>
            <p class="para_item">POST_EVENT &lt;post_name&gt; specifies that the Event of name &quot;name&quot; is output to the Postprocessor as an Event with name &quot;post_name&quot;. This attribute of the EVENT is optional and if not specified the event is output to the Post Processor as an Event with name &quot;name&quot;. </p>
         </li>
         <li>
            <p class="para_item">UI_LABEL &lt;ui_name&gt; specifies that &quot;ui_name&quot; is the string used in the title of the dialog presented to define the event. This attribute of the EVENT is optional and if not specified the event name itself is used as the &quot;ui_name&quot;. </p>
         </li>
         <li>
            <p class="para_item">CATEGORY attribute specifies the Machining Mode in which the Event is relevant. This attribute is optional. The possible values it can have are the following: </p>
         </li>
         <li>
            <p class="para_item">Mill - Relevant in all milling operations. </p>
         </li>
         <li>
            <p class="para_item">Drill - Relevant in Drilling operations.</p>
         </li>
         <li>
            <p class="para_item">Lathe - Relevant in all Lathe operations. </p>
         </li>
         <li>
            <p class="para_item">WEDM - Relevant in WireEDM operations. </p>
            <p class="para_item">The Event can be specified to be relevant in more than one Machining Mode. When this attribute is not specified the Event becomes relevant in all Machining Modes.</p>
            <ul>
               <li>
                  <p class="para_item">PARAM &lt;param_name_1&gt; specifies a parameter of the Event. The parameter has a name &quot;param_name_1&quot;. </p>
               </li>
               <li>
                  <p class="para_item">TYPE is an attribute of the parameter and specifies what the type of the parameter is. The possible values for TYPE are </p>
               </li>
               <li>
                  <p class="para_item">i - an integer </p>
               </li>
               <li>
                  <p class="para_item">d - a real number </p>
               </li>
               <li>
                  <p class="para_item">s - a string </p>
               </li>
               <li>
                  <p class="para_item">o - one of a possible set of options </p>
               </li>
               <li>
                  <p class="para_item">b - a boolean</p>
               </li>
               <li>
                  <p class="para_item">p - a point </p>
               </li>
               <li>
                  <p class="para_item">v - a vector</p>
               </li>
               <li>
                  <p class="para_item">DEFVAL &lt;default value&gt; as a string specifies the default value that the parameter can have. This is an optional attribute and if not specified the following are the defaults according to the TYPE of the parameter </p>
               </li>
               <li>
                  <p class="para_item">i - default value is 0 </p>
               </li>
               <li>
                  <p class="para_item">d - default value is 0.0 </p>
               </li>
               <li>
                  <p class="para_item">s - default value is an empty string </p>
               </li>
               <li>
                  <p class="para_item">o - default value is the first one of the list of options provided </p>
               </li>
               <li>
                  <p class="para_item">b - default value is FALSE</p>
               </li>
               <li>
                  <p class="para_item">p - default value does not apply </p>
               </li>
               <li>
                  <p class="para_item">v - default value does not apply</p>
               </li>
            </ul>
         </li>
         <li>
            <p class="para_item">TOGGLE is an attribute of the parameter, which specifies that the parameter may be optionally defined and that the default value is either On or Off. The TOGGLE attribute is optional and if not specified the parameter is taken to be mandatory. </p>
         </li>
         <li>
            <p class="para_item">OPTIONS is an attribute of the parameter, which applies only when the TYPE of the parameter is 'o'. This is a mandatory attribute when the TYPE is 'o'. This provides all the possible values that the parameter can have. The values are specified as comma separated strings. </p>
         </li>
         <li>
            <p class="para_item">UI_LABEL &lt;ui_name&gt; specifies that &quot;ui_name&quot; is the string that appears in the dialog presented to define the event. This is an optional attribute and if not specified the &quot;param_name_1&quot; itself is used as the &quot;ui_name&quot;. </p>
         </li>
      </ul>
      <p class="para_topic">The definition of the Events are done in a .cdl file. The file can contain as many Events as desired. This file is specified as a part of the Machine Definition. This default .cdl file is located in the mach&rarr;resource&rarr;user_def_events directory in the standard system installation.</p>
      <div class="title_division">Example</div>
      <p class="para_division">An example of a User Defined Event structure is as follows:</p><pre class="indent">EVENT my_ude
{ 
POST_EVENT test_ude
UI_LABEL &quot;My Ude&quot;
CATEGORY Mill Drill 
PARAM int_param 
{ 
TYPE i 
DEFVAL &quot;0&quot; 
TOGGLE On 
UI_LABEL &quot;Integer Parameter&quot;
&nbsp;} 
PARAM option_param 
{ 
TYPE o 
DEFVAL &quot;Option_2&quot; 
OPTIONS &quot;Option_1&quot;,&quot;Option_2&quot;,&quot;Option_3&quot;
UI_LABEL &quot;Option Parameter&quot;
&nbsp;}
PARAM double_param 
{ 
TYPE d 
DEFVAL &quot;5.0&quot; 
UI_LABEL &quot;Double Parameter
}
PARAM point_param 
{ 
TYPE p
UI_LABEL &quot;Point Parameter&quot;
}
}</pre><p class="para_division">The User Defined Event, My Ude, appears in the Available List in the User Defined Events dialog. </p>
      <p class="para_division">When the My Ude is added or edited a dialog titled My Ude appears.</p>
      <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 you want to add characters that are difficult to enter on the keyboard into strings (newline or backspace) use the octal-escape notation. Enter this in a doubly-quoted string and with the following format: &quot;\xyz&quot; where xyz is the octal (base 8) code of the desired ASCII character. To determine the desired octal code you can consult an ASCII table. For example, to print an 'A', backspace, and another 'A', use the string &quot;A\010A&quot;. This works because the octal code of a backspace in ASCII is 010. If you want to use a backslash in a string without activating the octal-escape logic then use single quotes around the string: 'A\010A'. This treats the backslash simply as a backslash character with no other special meaning.</p>
               </div>
            </td>
         </tr>
      </table>
   </body>
</html>