custom button want execute c program

Moderators: TomKerekes, dynomotion

Post Reply
User avatar
cnc_freak
Posts: 55
Joined: Fri Apr 20, 2018 5:36 am

custom button want execute c program

Post by cnc_freak » Tue Jan 29, 2019 5:14 pm

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?
Attachments
Param_2.c
(2.03 KiB) Downloaded 122 times
2AxisPlasmaOxy_PARAM_1024x768.scr
(47.42 KiB) Downloaded 131 times

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: custom button want execute c program

Post by TomKerekes » Tue Jan 29, 2019 5:46 pm

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
Regards,

Tom Kerekes
Dynomotion, Inc.

User avatar
cnc_freak
Posts: 55
Joined: Fri Apr 20, 2018 5:36 am

Re: custom button want execute c program

Post by cnc_freak » Tue Jan 29, 2019 8:13 pm

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.

User avatar
cnc_freak
Posts: 55
Joined: Fri Apr 20, 2018 5:36 am

Re: custom button want execute c program

Post by cnc_freak » Wed Jan 30, 2019 6:53 am

Here are the two screen files.
Attachments
2AxisPlasmaOxy_PARAM_1024x768.scr
(47.9 KiB) Downloaded 135 times
2AxisPlasmaOxy_MAIN_1024x768.scr
(47.61 KiB) Downloaded 127 times

User avatar
cnc_freak
Posts: 55
Joined: Fri Apr 20, 2018 5:36 am

Re: custom button want execute c program

Post by cnc_freak » Wed Jan 30, 2019 7:52 am

I install the last version 435b and now everything works fine.
Thank you for you time.

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: custom button want execute c program

Post by TomKerekes » Thu Jan 31, 2019 5:40 pm

Great. Thanks for taking the time to post back.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply