Using a Message Input Box

Moderators: TomKerekes, dynomotion

Post Reply
jackgiz
Posts: 37
Joined: Wed Mar 08, 2023 3:37 am

Using a Message Input Box

Post by jackgiz » Sat Nov 23, 2024 1:26 am

Hi Tom,
I would like to use a message input box in one of my programs but would like to preload the drop down list with a series of numbers like .1, .2 .3 etc.
The message box pops up in my program but the drop down is empty. I can type in a number and the program continues on successfully. Is there a simple way to load the drop down with the same numbers everytime?
Jack

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

Re: Using a Message Input Box

Post by TomKerekes » Sat Nov 23, 2024 6:57 pm

Hi Jack,

Here is a patch for Version 5.3.6 to allow the drop down values to be specified separated by ';'. Copy to the \KMotion\Release folder.

KMotionCNC.exe

Modifed source code:
SetValue.cpp

Example

Code: Select all

#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"


main()
{
    float value;
    
    // Ask Operator desired rotation angle with drop down values specified
    if (!InputBox("Enter Angle in degrees;45.0;90.0;10.0",&value))  
    {
    	printf("value = %f\n", value);
    }
}

Please let us know if it works for you.
Regards,

Tom Kerekes
Dynomotion, Inc.

jackgiz
Posts: 37
Joined: Wed Mar 08, 2023 3:37 am

Re: Using a Message Input Box

Post by jackgiz » Tue Nov 26, 2024 6:27 pm

Hi Tom,
The patch was a bust. When I loaded the patch (KmotionCNC.exe) my machine started behaving strangely. If I raised the Z axis as soon as I release the up arrow the Z would turn around and return to where it was before I pressed the up arrow. When I pressed the up arrow then the left arrow disaster struck. The Y returned to it's start position but the Z just kept moving down. Hitting the EStop had no effect. The bit went into the table before I could kill power. The good news is my table is MDF so the engraving bit was not harmed. I tried reflashing the Kflop but that didn't help. Going back to the original KmotionCNC everything worked correctly again.

I wasn't sure what to do with the SetValue.cpp. I copied it to the Kmotion\Release sub-directory. Obviously the InputBox dropdown list is still not working.

Jack

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

Re: Using a Message Input Box

Post by TomKerekes » Tue Nov 26, 2024 11:19 pm

Hi Jack,

Sorry for the problem. GCodeInterpreter.dll needs to be updated also. Copy to the \KMotion\Release folder.

Make sure you are running Version 5.3.6.

GCodeInterpreter.dll

I wasn't sure what to do with the SetValue.cpp.
You don't need this unless you need to re-compile KMotionCNC.exe. If so, it would replace the SetValue.cpp in folder \PC VC Examples\KMotionCNC
Regards,

Tom Kerekes
Dynomotion, Inc.

jackgiz
Posts: 37
Joined: Wed Mar 08, 2023 3:37 am

Re: Using a Message Input Box

Post by jackgiz » Fri Nov 29, 2024 11:37 pm

HI Tom,
That was it. The new DLL file fixed the rubber band effect I was having and the drop down is working!!

Happy Thanksgiving.

Jack

Post Reply