
------------------------------------------------------------------------------
1.53 Write custom macro variable. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_wrmacro
[Syntax]
#include <data.h>
#include <fwindow.h>
short cnc_wrmacro( short number, short length, long mcr_val
, short dec_val ) ;
[Arguments]
number Custom macro variable number.
length Data block length ( =10 ).
mcr_val Custom macro variable value.
dec_val Digit number after decimal point.
[Return]
EW_OK( 0) Successful.
EW_LENGTH( 2) Incorrect data block length "length".
EW_NUMBER( 3) Incorrect custom macro variable number "number".
EW_DATA( 5) Value of the custom macro variable is out of the limit.
EW_NOOPT( 6) There are no required options.
The related options;
- Custom macro.
- Custom macro common variable addition (#100 to #199
and #500 to #999)
EW_BUSY(-1) An attempt was made to execute this command when other
window processing of a low-speed type was in progress.
Execute the command after the window processing has
ended.
[Description]
Writes the custom macro variable data in the CNC.
This function is used for controlling flow of the machining program of
CNC by the application program exchanging data between the custom
macro program in CNC and the application program, etc.
Types of custom macro variable are as follows.
(1) Local variables ( #1,..,#33 )
Writable. The local variables which belong to the macro program just
being executed when the application program calls this function are
altered.
(2) Common variables ( #100,..,#149, #500,..,#531 )
Writable. In case that Custom macro common variable 900 sets option is
added, #100,..,#199 and #500,..,#999 are available to be written.
(3) System variables ( #1000,.. )
Writable for only changeable variables.