
B-66244EN/03 4.EMBEDDING OF C APPLICATIONS
- 275 -
void usr_wmacro(unsigned long data)
{
int ret;
ret = cnc_wrmacro(100, 10, data, 3);
if (ret != 0) {
// Error handling
}
}
Example 2
If an argument other than write data is required in a user function
Create a user function with usr_wmacro(char *param, unsigned long
data).
Specify usr_wmacro[param] as the write function specification in the
ten-key pad call control.
The function is called with usr\wmacro(param,data) from the ten-key
pad call control.
(data is the input value from the ten-key pad.)
void usr_wmacro(char *param, unsigned long data)
{
int ret;
int dec;
int num
// Analysis of param
// For example, decide the common variable number (num)
and number of decimal places (dec).
ret = cnc_wrmacro(num, 10, data, dec);
if (ret != 0) {
// Error handling
}
}
Communication task, alarm task, window task, and high-level task
The main function of each task must be created by the machine tool
builder.
From the main function created by the machine tool builder, the
functions necessary to run the FANUC PICTURE library must be
called.
Currently, the functions necessary to run FANUC PICTURE are as
follows.
Task name Function name Remarks
Communication task -
Alarm task void Fanuc_Alarm_Task_Init(void)
void Fanuc_Alarm_Task_Main(void)
Optimum
period 128ms
Window task -
High-level task -