Page 1 of 1

custom button want execute c program

Posted: Tue Jan 29, 2019 5:14 pm
by cnc_freak
Hello.
I'm running the kmotion version 434k.
I have put some custom buttons on the screen via screen editor.
I want those buttons, when pressed to execute a specific c program on thread 3 for example.
I have configure for example, the IDC_But20 as "Button", Var -1 and script action, "Program//run a KMotion User C program".
When i execute the c program from Kmotion environment, everything is ok, but when i execute via the button on the kmotionCNC, it brings an error
"Invalid thread number 0 Valid Range (1-7)"
Attached is the screen i have made and the c program.
Please advice what do i do wrong?

Re: custom button want execute c program

Posted: Tue Jan 29, 2019 5:46 pm
by TomKerekes
Hi cnc_freak,

You don't seem to have anything configured for IDC_But20. Did you send the correct file? I see:

ID:IDC_But20,Type:PUSHBUTTON,X:615,Y:390,CX:100,CY:30,Show:1,Var:1064,Style:1,BitmapFile:;,Colors:;;;,Font:MS Sans Serif,FontSize:11,HotKey:-1,Bold:0,Italic:0,Text:Label,ToolTipText:,Script:

But the error is indicating your Thread number is 0 not valid Threads 1-7

Re: custom button want execute c program

Posted: Tue Jan 29, 2019 8:13 pm
by cnc_freak
Ok i send the wrong screen file.
Try to configure the button to execute the c program "param_2.c" at thread 3 and see what happens.
I try tomorrow to send the write screen file.

Re: custom button want execute c program

Posted: Wed Jan 30, 2019 6:53 am
by cnc_freak
Here are the two screen files.

Re: custom button want execute c program

Posted: Wed Jan 30, 2019 7:52 am
by cnc_freak
I install the last version 435b and now everything works fine.
Thank you for you time.

Re: custom button want execute c program

Posted: Thu Jan 31, 2019 5:40 pm
by TomKerekes
Great. Thanks for taking the time to post back.