Hi vadim_cnc,
Here is an example screen that sets two Persist Variables (double #10 and #11) in KFLOP
Here are the Programs for each button to read and save the value
Code:
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
#define VALUE1_DVAR 10
main()
{
double d;
// Read double from a KMotionCNC Edit Control
// Persist Var identifies the Control and contents specifies
// where the string data should be placed in the
// Gather Buffer as an offset in words
if (GetEditControlDouble(&d, 160, 1000))
{
printf("Error Reading Edit Control Var=160\n");
return;
}
SetUserDataDouble(VALUE1_DVAR,d); //Save it in a global persist double variable
printf("Variable set to %f\n",GetUserDataDouble(VALUE1_DVAR)); // print it as a test
}
Code:
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
#define VALUE2_DVAR 11
main()
{
double d;
// Read double from a KMotionCNC Edit Control
// Persist Var identifies the Control and contents specifies
// where the string data should be placed in the
// Gather Buffer as an offset in words
if (GetEditControlDouble(&d, 161, 1000))
{
printf("Error Reading Edit Control Var=161\n");
return;
}
SetUserDataDouble(VALUE2_DVAR,d); //Save it in a global persist double variable
printf("Variable set to %f\n",GetUserDataDouble(VALUE2_DVAR)); // print it as a test
}
Here is an example of how to read and print the values in KFLOP
Code:
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
#define VALUE1_DVAR 10
#define VALUE2_DVAR 11
main()
{
printf("2 Variable set to %f %f\n",
GetUserDataDouble(VALUE1_DVAR),
GetUserDataDouble(VALUE2_DVAR)); // print it as a test
}
I've also attached the screen script. Note extensions are changed for upload to cnczone
HTH
Regards