Page 1 of 1
Using a Message Input Box
Posted: Sat Nov 23, 2024 1:26 am
by jackgiz
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
Re: Using a Message Input Box
Posted: Sat Nov 23, 2024 6:57 pm
by TomKerekes
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.
Re: Using a Message Input Box
Posted: Tue Nov 26, 2024 6:27 pm
by jackgiz
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
Re: Using a Message Input Box
Posted: Tue Nov 26, 2024 11:19 pm
by TomKerekes
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
Re: Using a Message Input Box
Posted: Fri Nov 29, 2024 11:37 pm
by jackgiz
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