Introduction to the GO2cam software development kit
Definition of the software development kit
The GO2cam software development kit allows opening in Pascal interpreted language, or in Windows COM (VB net, C ++, C #, ...) of the GO2cam database. It allows you to write macros that will interact with GO2cam in order to execute automated tasks. A macro written in interpreted Pascal can be automatically executed when GO2cam is launched. Just add the parameters "-s macro_file_name" to the launch shortcut.
Exemple :
The software development kit allows :
- To create a settings dialog box.
- To manage the data in the dialog box.
- To read GO2cam geometry.
- To create GO2cam geometry.
- To read GO2cam machining
A GO2cam macro is an ASCII file of Pascal type which is interpreted by GO2cam. Its extension must be SPI ou PPI.
In the directory :
- **./process/std** are defined the standard geometric macros ".PPI".
- **./process/specif** are defined the specific geometric macros ".SPI".
An error file Pascal.ERR is create if the macro execution went wrong. It summarizes the syntax or execution errors by indicating the problematic line number.
Using the software development kit
Using the specific tools / macros menu, a file browser allows the selection of the macro to run. Once the macro has been selected, a possible dialog box containing the parameters is displayed if necessary. Then just click on the confirm button in the dialog box, after entering the desired parameters, to launch the execution of the macro. In the event of a problem, the key combination ctrl + z returns to the initial state.
How to access the function library ?
It is necessary to know or have some programming knowledge before starting to write macros. The library functions are called by 3 Pascal keywords.
- PCALL(name of the function, list of parameters ...); Procedure not returning a result.
- ICALL(name of the function, list of parameters ...); Procedure returning an integer result (function).
- RCALL(name of the function, list of parameters ...); Procedure returning a real result (function).
How to create a macro
Macro file preparation
The file is made up of 2 (or 3) Pascal procedures.
{************************************}
{********** Macro GO2cam **********}
{************************************}
{ Define macro parameters }
PROCEDURE PPI_PARAMETRE_PROCESSUS;
BEGIN
END;
{ Management and Update of macro parameters. Optional procedure }
PROCEDURE PPI_MAJ_PARAMETRE_PROCESSUS;
BEGIN
END;
{ Macro execution }
PROCEDURE PPI_ATELIER_PROCESSUS;
BEGIN
END;
- PPI_PARAMETRE_PROCESSUS : This Pascal procedure is called by GO2cam for the construction of the macro dialog box. It allows to define the parameters to display in the dialog box.
- PPI_MAJ_PARAMETRE_PROCESSUS : This Pascal procedure is optional. It allows to manage the inputs of a dialog box. By default GO2cam uses its own management for updating the fields in the dialog box.
- PPI_ATELIER_PROCESSUS : This procedure is the engine of the macro. It describes the actions to be carried out throughout the execution of the macro.
Parameters definition
The definition of the parameters takes place in the definition procedure of the dialog box : PPI_PARAMETRE_PROCESSUS.
It must contain :
- The title of the dialog box.
- The positioning of the parameters.
- The type of display of parameters.
- The initialization value of the parameters.
SPI_WIN_write_title_param
The SPI_WIN_write_title_param function is used to create the title of the dialog box.
Examples :
PCALL(SPI_WIN_write_title_param, 'My dialog box');
SPI_WIN_write_newpage_param
The SPI_WIN_write_newpage_param function allows the creation of a new tab in the dialog box. All the parameters defined after this function will be displayed in this tab.
The final size of the dialog box will be the size of the largest of the tabs.
Examples :
PCALL(SPI_WIN_write_newpage_param);
SPI_WIN_write_title_page_param
The SPI_WIN_write_title_page_param function allows the creation of a title on the current tab.
Examples :
PCALL(SPI_WIN_write_title_page_param, 'My tab');
SPI_WIN_write_format_param
The SPI_WIN_write_format_param function defines the display format and the positioning of the parameter in the dialog box. A number of formats are available depending on the type of parameter desired.
Examples :
PCALL(SPI_WIN_write_format_param, 0, 5, 250, 10, 0);
{ will allow to obtain a type 0 format, to position the parameter on line 0.5 }
{ in column 25 and the field will have 10 input characters. }
SPI_WIN_write_inactive_param
The SPI_WIN_write_inactive_param function allows you to gray out a field.
SPI_WIN_write_domain_param
The SPI_WIN_write_domain_param function is used to specify the field of use of a parameter.
The domain definition function must be positioned between the format of the parameter and its definition.
The domain definition function is optional.
The domain is defined by a list of values or ranges that the parameter can accept. This function can only be used with integer or real type parameters.
Examples :
For an integer : '[10,20,30,50..60,80..100]'
Possible value 10 or 20 or 30.
Possible interval between 50 and 60 or 80 and 100
For a real : '[0.0..3.14159,6.283]'
Possible value 6.283
Possible interval between 0.0 and 3.14159
Available settings
Six types of settings are available.
A parameter is defined by its label which will allow it to be identified and used.
A comment or separator parameter can beautify the dialog box, but cannot have a value.
- Boolean : SPI_WIN_write_boolean_param
- Integer : SPI_WIN_write_integer_param
- Real: SPI_WIN_write_real_param
- String : SPI_WIN_write_string_param
- Comment : SPI_WIN_write_comment_param
- Separator : SPI_WIN_write_frame_param
Examples :
PCALL(SPI_WIN_write_real_param,'DIAMETER','Hole diameter :',40.0);
Allows to create a real type parameter which will have as label 'DIAMETER'.
The input field will have the caption : 'Hole diameter :' and the default value will be 40.0.
The following code is used to display and enter a diameter, depth and precision in a dialog box.
PROCEDURE PPI_PARAMETRE_PROCESSUS;
BEGIN
PCALL(SPI_WIN_write_title_param, 'Hole parameters');
PCALL(SPI_WIN_write_format_param, 0, 5, 200, 10, 0);
PCALL(SPI_WIN_write_domain_param, '[1.0..40]');
PCALL(SPI_WIN_write_real_param, 'DIAMETER', 'Hole diameter :', 40.0);
PCALL(SPI_WIN_write_format_param, 0, 20, 200, 10, 0);
PCALL(SPI_WIN_write_real_param, 'DEPTH', 'Hole depth :', 20.0);
PCALL(SPI_WIN_write_format_param, 0, 35, 200, 10, 0);
PCALL(SPI_WIN_write_domain_param, '[0.001..0.5]');
PCALL(SPI_WIN_write_real_param, 'PREC', 'Hole accuracy :', 0.1);
END;
Files automatically created by SPIs
The last values entered in the dialog box by the user, are stored in a .USR file.
For example, if the macro is called TEST.SPI, GO2cam will create the file TEST.SPI.USR in the process/user directory.
At the next launch, the saved values will be read and replace the default values in the dialog box.
The SPI_WIN_ignore_usr function allows you to ignore the last stored values.
Management of the dialog box update
This update management is done in the procedure PPI_MAJ_PARAMETRE_PROCESSUS.
This procedure is optional. By default GO2cam uses its own management for updating the input fields.
Its use allows the customization of the management of the dialog box by interacting with the parameters in several ways:
- To gray or to ungray fields.
- To recalculate a field according to other fields.
- To prohibit certain values.
- ...
How to read the current value ?
The SPI_WIN_read_current_panel function allows to retrieve the modified field by indicating its reference label, its type and the value entered by the user.
How to update a value in the dialog box ?
It's just need to know the reference label of the parameter to update. 4 functions are available for this update:
- SPI_WIN_write_integer_panel: allows to write an integer value.
- SPI_WIN_write_boolean_panel: allows to write a boolean value.
- SPI_WIN_write_real_panel: allows to write a real value.
- SPI_WIN_write_string_panel: allows to write a value of type string.
How to gray or ungray a value ?
The function SPI_WIN_write_state_panel allows to gray or to ungray the field referenced by its label.
How to change an image (Boolean) ?
The SPI_WIN_write_bitmap_panel function allows to change the image of a boolean parameter referenced by its label.
How to change a choice list (integer) ?
The SPI_WIN_write_wordlist_panel function allows to change the choice list of an integer parameter referenced by its label.
How to read a value in the dialog box ?
It's just need to know the reference label for the parameter. 4 functions are then available:
- SPI_WIN_read_integer_panel: allows to read an integer value.
- SPI_WIN_read_boolean_panel: allows to read a boolean value.
- SPI_WIN_read_real_panel: allows to read a real value.
- SPI_WIN_read_string_panel: allows to read a value of type string.
Examples :
PROCEDURE PPI_PARAMETRE_PROCESSUS;
BEGIN
{**** Open the dialog box ****}
PCALL(SPI_WIN_write_title_param, 'tapping');
PCALL(SPI_WIN_write_format_param, 0, 1, 200, 10, 0);
PCALL(SPI_WIN_write_boolean_param, 'CHOICE', 'Small-Big', 0);
PCALL(SPI_WIN_write_format_param, 1, 15, 200, 10, 0);
PCALL(SPI_WIN_write_integer_param, 'DIAMETER', 'Diameter:-M2-M3-M4-M5-M6-M7-M8', 1);
PCALL(SPI_WIN_write_format_param, 2, 1, 10, 45, 13);
PCALL(SPI_WIN_write_boolean_param, 'ICON', '@B114.BMP', 0);
END;
PROCEDURE PPI_MAJ_PARAMETRE_PROCESSUS;
VAR ival,itype,ival1:INTEGER;
rval:REAL;
sval,lab:TC80;
BEGIN
{*Value update*}
PCALL(SPI_WIN_read_current_panel, lab, itype, ival, rval, sval);
CASE (itype) OF
1:BEGIN {Boolean}
PCALL(SPI_WIN_write_boolean_panel, lab, ival);
END;
2:BEGIN {Entier}
PCALL(SPI_WIN_write_integer_panel, lab, ival);
END;
3:BEGIN {Reel}
PCALL(SPI_WIN_write_real_panel, lab, rval);
END;
4:BEGIN {Chaine}
PCALL(SPI_WIN_write_string_panel, lab, sval);
END;
END;
{*Updating states*}
PCALL(SPI_WIN_read_boolean_panel, 'CHOICE', ival);
IF (ival = 0) THEN
PCALL(SPI_WIN_write_wordlist_panel, 'DIAMETER', 'M2-M3-M4-M5-M6-M7-M8')
ELSE
PCALL(SPI_WIN_write_wordlist_panel, 'DIAMETER', 'M12-M14-M16-M20-M26-M32');
PCALL(SPI_WIN_read_integer_panel, 'DIAMETER', ival1);
CASE (ival1) OF
1:BEGIN
IF (ival = 0) THEN
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B224.BMP')
ELSE
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B114.BMP');
END;
2:BEGIN
IF (ival = 0) THEN
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B225.BMP')
ELSE
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B115.BMP');
END;
3:BEGIN
IF (ival = 0) THEN
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B226.BMP')
ELSE
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B116.BMP');
END;
4:BEGIN
IF (ival = 0) THEN
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B227.BMP')
ELSE
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B117.BMP');
END;
5:BEGIN
IF (ival = 0) THEN
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B228.BMP')
ELSE
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B118.BMP');
END;
6:BEGIN
IF (ival = 0) THEN
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B229.BMP')
ELSE
PCALL(SPI_WIN_write_bitmap_panel, 'ICON', 'B119.BMP');
END;
END;
END;
Definition of the macro execution procedure
The definition of the execution of the macro is done in the procedure PPI_ATELIER_PROCESSUS.
This procedure allows interaction with the GO2cam database in order to read and/or write geometric entities.
It also makes it possible to read machining cycles in order to extract information (time, speed, list of tools, ...)
Reading the parameters of the dialog box
There are 4 functions for reading parameters from the dialog box. They are used depending on the type of parameter to read:
- SPI_WIN_read_integer_param: Reading an integer parameter
- SPI_WIN_read_boolean_param: Reading of a boolean parameter
- SPI_WIN_read_real_param: Reading of a real parameter
- SPI_WIN_read_string_param: Reading a string parameter
Examples :
To read the value of a real parameter having for label "REAL_VALUE" in the variable "rVal", it will be necessary to use the function:
PCALL(SPI_WIN_read_real_param, 'REAL_VALUE', rVal);
Management of the geometric database
Reading of the geometric database
Principle : browse the geometric database and test if the entity is valid (not deleted, active).
- SPI_GEO_last_elt : Reading of the number of geometrical element of the GO2cam database.
- SPI_GEO_valid_elt : Test if the geometrical element of the database is valid.
- SPI_GEO_read_mark_elt : Test if the geometric element of the database is marked.
Examples :
Loop on the valids and selected elements of the database.
PPI_ATELIER_PROCESSUS;
VAR ind,nbelt:INTEGER;
BEGIN
nbelt := ICALL(SPI_GEO_last_elt);
FOR ind:= 1 TO nbelt DO
IF ICALL(SPI_GEO_valid_elt, ind) = SPI_YES THEN
IF ICALL(SPI_GEO_read_mark_elt, ind) = SPI_YES THEN
writeln('Elément valide :',ind);
END;
How to read a geometric entity ?
To work on a geometric entity, you need to know its database index. You must also test that it is valid, that is, not deleted.
- SPI_GEO_read_type_elt : Reading of the type of the entity (SPI_ELTTYPE_POINT ...).
- SPI_GEO_read_layer_elt : Reading of the layer number of the entity.
- SPI_GEO_read_color_elt : Reading of the color number of the entity (SPI_COLOR_BLUE ...).
- SPI_GEO_read_linetype_elt : Reading the line type of the entity (SPI_LINETYPE_AXES ...).
- SPI_GEO_read_linewidth_elt : Reading the line thickness of the entity (SPI_LINEWIDTH_DOUBLE ...).
- SPI_GEO_read_mater_elt : Reading of the material of the entity.
- SPI_GEO_read_plane_elt : Reading of the plane number of the entity.
- SPI_GEO_read_mark_elt : Test if the entity is selected or not (return: SPI_YES / SPI_NO).
- SPI_GEO_read_name_elt : Reading of the entity's label.
- SPI_GEO_read_params_elt : Reading of the table of reality of the canonical form of the entity.
Examples :
Displays the valid elements of the database.
PROCEDURE PPI_ATELIER_PROCESSUS;
VAR i,j,nb,itype : INTEGER;
cl,cc,plan,ierr : INTEGER;
mot : TC80;
elt : TR9;
rval : REAL;
BEGIN
{*Reading of the geometric database*}
nb := ICALL(SPI_GEO_last_elt);
writeln('number of elements in the database : ', nb);
FOR i:= 1 TO nb DO
BEGIN
IF ICALL(SPI_GEO_valid_elt, i) = SPI_YES THEN
BEGIN
itype := ICALL(SPI_GEO_read_type_elt, i);
cc := ICALL(SPI_GEO_read_layer_elt, i);
cl := ICALL(SPI_GEO_read_color_elt, i);
plan := ICALL(SPI_GEO_read_plane_elt, i);
ierr := ICALL(SPI_GEO_read_name_elt, mot, i);
writeln('itype : ',itype,' lab :', mot, cc, cl, plan);
ierr := ICALL(SPI_GEO_read_params_elt, 9, elt, i);
FOR j:= 0 TO 8 DO writeln(' ',j,' :',elt[j],' ');
END
END
END;
How to display a geometric entity ?
It is possible to refresh the display of a geometric entity or the entire geometric database.
- SPI_DRAW_draw_elt : Displays an entity.
- SPI_DRAW_redraw : Refreshes the entire database.
How to modify a geometric entity ?
Each read function in the database has an equivalent function for writing.
The modification of the geometric entities is always done by the index of the element concerned.
- SPI_GEO_write_type_elt : Writing of the type of the entity (SPI_ELTTYPE_POINT ...)
- SPI_GEO_write_layer_elt : Writing of the layer number of the entity
- SPI_GEO_write_color_elt : Writing of the color of the entity (SPI_COLOR_BLUE ...).
- SPI_GEO_write_linetype_elt : Writing of the line type of the entity (SPI_LINETYPE_AXES ...).
- SPI_GEO_write_linewidth_elt : Writing the line thickness of the entity (SPI_LINEWIDTH_DOUBLE ...).
- SPI_GEO_write_mater_elt : Writing of the material of the entity.
- SPI_GEO_write_plane_elt : Writing of the plane number of the entity.
- SPI_GEO_write_mark_elt : Writing of the selection state of the entity (SPI_YES / SPI_NO).
- SPI_GEO_write_name_elt : Writing the label of the entity.
- SPI_GEO_write_params_elt : Writing of the real table of the canonical form of the entity.
Examples :
Modification of the layer number of the selected entities.
PROCEDURE PPI_ATELIER_PROCESSUS;
VAR i,nb,mark,ierr:INTEGER;
BEGIN
{*Reading of the geometric database*}
nb := ICALL(SPI_GEO_last_elt);
FOR i:= 1 TO nb DO
BEGIN
IF ICALL(SPI_GEO_valid_elt, i) = SPI_YES THEN
IF ICALL(SPI_GEO_read_mark_elt, ind) = SPI_YES THEN
ierr := ICALL(SPI_GEO_write_layer_elt, 10, i);
END
END;
How to create a geometric entity?
It is possible to quickly create a number of simple entities in the geometric database of GO2cam.
The attributes and plane number of the entity thus created are those of GO2cam by default :
- SPI_GEO_append_point
- SPI_GEO_append_segment
- SPI_GEO_append_block
- SPI_GEO_append_arc_2points_center
- SPI_GEO_append_arc_3points
- SPI_GEO_append_arc
- SPI_GEO_append_circle
- SPI_GEO_append_rectangle
- SPI_GEO_append_oblong
- SPI_GEO_append_text
Examples :
Creation of parallel segments.
PROCEDURE PPI_ATELIER_PROCESSUS;
VAR pt1,pt2 : TR3;
i,ind : INTEGER;
BEGIN
{*Initialization of 2 points*}
FOR i:=0 TO 2 DO
BEGIN
pt1[i] := 0.0;
pt2[i] := 0.0;
END;
pt1[0] := 10.0;
pt2[0] := 40.0;
FOR i := 0 TO 10 DO
BEGIN
pt1[1] := i*10.0;
pt2[1] := pt1[1];
ind := ICALL(SPI_GEO_append_segment, pt1, pt2);
writeln('database index :', ind);
END
END;
Examples :
pt1[0] := 20.5;
pt1[1] := 10.5;
pt1[2] := 0.0;
ind := ICALL(SPI_GEO_append_free_elt);
ierr := ICALL(SPI_GEO_write_type_elt, SPI_ELTTYPE_POINT, ind);
ierr := ICALL(SPI_GEO_write_color_elt, SPI_COLOR_BLUE, ind);
ierr := ICALL(SPI_GEO_write_layer_elt, 1, ind);
ierr := ICALL(SPI_GEO_write_plane_elt, 1, ind);
ierr := ICALL(SPI_GEO_write_name_elt, 'vide', ind);
ierr := ICALL(SPI_GEO_write_params_elt, 3, pt1, ind);
Deletion of a geometric entity
Creation of a plan by 3 points
- SPI_GEO_append_plane_3points
Dimension and text management
The access functions to dimensions and texts respond like geometric entities to the functions :
- Access :
- SPI_GEO_valid_elt : Test if an element is valid.
- SPI_GEO_read_mark_elt : Test if an element is marked.
- etc ....
- Reading :
- SPI_GEO_read_type_elt : Reading of the type of the entity (SPI_ELTTYPE_TEXT ...).
- SPI_GEO_read_layer_elt : Reading the layer number of the entity.
- etc ....
- Writing :
- SPI_GEO_write_color_elt : Write the color of the element.
- SPI_GEO_write_linetype_elt : Writing the line type (SPI_LINETYPE_DOT ...).
- etc ....
- Display :
- SPI_DRAW_draw_elt
- etc ....
The management of the dimension and the texts has functions which are dedicated to it :
How to read all the characteristics ?
- SPI_GEO_read_carac_dimension : Reading a dimension.
- SPI_GEO_read_carac_text : Reading of a text (simple or block).
- SPI_GEO_read_carac_annot_sb : Reading of an annotation (simple or block).
- SPI_GEO_read_carac_annot_rugo : Reading a roughness annotation.
- SPI_GEO_read_carac_annot_tdf : Reading a shape tolerance annotation.
Examples :
VAR ierr,ind : INTEGER;
s1,s2,s3,s4,s5,s6,s7:TC80;
BEGIN
{....}
ierr := ICALL(SPI_GEO_read_carac_dimension, s1, s2, s3, s4, s5, s6, s7, ind);
IF (ierr == SPI_YES) THEN
BEGIN
writeln ('Prefix ................=',s1);
writeln ('Nominal user dimension =',s2);
writeln ('True nominal dimension =',s3);
writeln ('Dimension H. opening . =',s4);
writeln ('Suffix ............... =',s5);
writeln ('Higher Tolerance ..... =',s6);
writeln ('Lower Tolerance ...... =',s7);
END;
END;
How to read the parameters of a text in the database
- SPI_GEO_read_integer_text : Reading an integer parameter of the text.
- SPI_GEO_read_boolean_text : Reading a boolean parameter of the text.
- SPI_GEO_read_real_text : Reading a real parameter of the text.
- SPI_GEO_read_string_text : Reading a string parameter of the text.
- SPI_GEO_read_location_text : Reading the position of the text.
Examples :
VAR ierr,ind : INTEGER;
tsize : REAL;
tfont : TC80;
BEGIN
{....}
ierr := ICALL (SPI_GEO_read_real_text,SPI_TEXT_SIZE, tsize, ind);
IF (ierr = SPI_YES) THEN
BEGIN
writeln ('Taille du texte =', tsize);
END;
ierr := ICALL (SPI_GEO_read_string_text,SPI_TEXT_FONT, tfont, ind);
IF (ierr = SPI_YES) THEN
BEGIN
writeln ('Police de caractère =', tfont);
END;
END;
How to create a new text in database
Examples :
VAR ind : INTEGER;
pt : TR3;
text: TC80;
BEGIN
strcpy (text, 'HELLO WORLD');
pt[0] := 20.0;
pt[1] := 50.0;
pt[2] := 0.0;
ind := ICALL (SPI_GEO_append_text, pt, text);
END;
How to modify a text in database
- SPI_GEO_write_integer_text : Write an integer parameter of the text.
- SPI_GEO_write_boolean_text : Write a boolean parameter of the text.
- SPI_GEO_write_real_text : Write a real parameter of the text.
- SPI_GEO_write_string_text : Write a string parameter of the text.
- SPI_GEO_write_location_text : Writing the position of the text.
Examples :
VAR ierr,ind : INTEGER;
tratio : REAL;
tfont : TC80;
BEGIN
{....}
tratio := 0.5;
strcpy (tfont, 'Arial');
ierr := ICALL(SPI_GEO_write_real_text, SPI_TEXT_RATIO, tratio, ind);
ierr := ICALL(SPI_GEO_write_string_text, SPI_TEXT_FONT, tfont, ind);
END;
How to determine the length or the bounding box of a text
- SPI_TXT_length_text : Calculates the length of the text.
- SPI_TXT_frame_text : Calculates the text frame.
Examples :
VAR ierr,ind : INTEGER;
tsize,tratio : REAL;
tfont,text : TC80;
lon : REAL;
BEGIN
tsize := 15.0;
tratio := 0.5;
strcpy (tfont, 'Arial');
strcpy (text, 'HELLO WORLD');
ierr := ICALL(SPI_TXT_lenght_text, text, tsize, tratio, tfont, lon);
writeln ('Length =',lon);
END;
Management of machining cycles
The functions detailed below allow to work with the machining database. These functions allow to :
- Browse the machining operation list.
- Read an existing cycle.
- Extract desired information.
- ...
How to browse the machining operation list ?
It is possible to cycle through the cycles one by one using the following functions :
- SPI_PRC_next_process : Activation of the next machining cycle taking into account the filters in progress.
- SPI_PRC_previous_process : Activation of the previous cycle taking into account the filters in progress.
Examples :
BEGIN
{....}
nocyc := 0;
nopro := 0;
Continue := ICALL(SPI_PRC_next_process, nocyc, nopro);
writeln('******** Operation list by cycles ***********');
WHILE Continue = SPI_YES DO
BEGIN
writeln('Cycle number ', nopro, nocyc);
Continue := ICALL(SPI_PRC_next_process, nocyc, nopro);
END;
END;
Another method consists in looping over all the machining cycles and reading the sequence number of the cycle in the operation list.
- SPI_PRC_last_process : Reading of the number of processes in the operation list.
- SPI_PRC_read_number_process : Reading the number of cycles in a process.
- SPI_PRC_order_process : Reading of the sequence number of a cycle in the operation list.
Examples :
BEGIN
{....}
nbpro := ICALL(SPI_PRC_last_process);
FOR nopro:=1 TO nbpro DO
BEGIN
indordre := ICALL(SPI_PRC_order_process, nopro);
writeln('Order number :',indordre);
END;
END;
How to read a machining cycle ?
To read any machining cycle, its process number and its cycle number must be known.
A function makes it possible to load the cycle in a memory buffer in order to read its parameters.
The technology access functions allow parameters to be read using keys.
- SPI_PRC_init_process : Initializes the memory buffer for the cycle to be read.
- SPI_PRC_free_process : Releases the memory buffer for the cycle read.
- SPI_PRC_read_process : Loads a cycle into the memory buffer.
- SPI_PRC_read_integer_tec_process: Reads an integer parameter in the cycle.
- SPI_PRC_read_reel_tec_process : Reads a real parameter in the cycle.
- SPI_PRC_read_string_tec_process : Reads a string parameter in the cycle.
- SPI_PRC_read_number_subcycle_process : Reads the number of sub-cycles in the cycle
- SPI_PRC_read_reference_subcycle_process : Reads the references of a sub-cycle.
How to move a cycle in the operation list ?
- SPI_PRC_move_process : Moving of a cycle regarding another.
- SPI_PRC_write_order_process : Reconstruction of the operation list.
How to read and write paths in a machining cycle ?
To start, the references of the sub-cycle to be treated must be read.
The references contain the part path and the tool center path (these two paths can be equal).
The cycle path elements are read in the same way as the geometric elements.
- SPI_PRC_read_plane_path : Reading of the plan number of the machining path.
- SPI_PRC_write_plane_path : Writing of the plan number of the machining path.
- SPI_PRC_read_layer_path : Reading the layer number of the machining path.
- SPI_PRC_write_layer_path : Writing the layer number of the machining path.
- SPI_PRC_read_color_path : Reading of the color of the machining path.
- SPI_PRC_write_color_path : Writing of the color of the machining path.
- SPI_PRC_read_type_path : Reading the type of machining path.
- SPI_PRC_write_type_path : Writing the type of machining path.
- SPI_PRC_read_type_machining_path : Reading of the machining type of the machining path.
- SPI_PRC_write_type_machining_path : Writing of the machining type of the machining path.
- SPI_PRC_read_params_path : Reading of the canonical form of the machining path.
- SPI_PRC_write_params_path : Writing of the canonical form of the machining path.
- SPI_PRC_read_name_path : Reading the name of the machining path.
- SPI_PRC_write_name_path : Writing the name of the machining path.
- SPI_PRC_valid_path : Test if the machining path is valid.
- SPI_PRC_del_path : Deletion of an element from the machining path.
- SPI_PRC_insert_path : Insertion of a blank element on the machining path.