Search found 226 matches

by Moray
Tue Jan 05, 2021 9:52 pm
Forum: User PC Applications and Libraries .Net
Topic: G-codes/offsets/tools with .Net
Replies: 120
Views: 18641

Re: G-codes/offsets/tools with .Net

Tom, a couple hopefully simple questions for you, in my attempt to replicate all the PC_COMM functionality. What is the equivalent of tool_table_index (D number) in dotNet? This is my code so far for PC_COMM_GET_MISC_SETTINGS, with the original KMotionCNC code commented out. case PC_COMM_GET_MISC_SE...
by Moray
Sun Jan 03, 2021 10:18 pm
Forum: User PC Applications and Libraries .Net
Topic: G-codes/offsets/tools with .Net
Replies: 120
Views: 18641

Re: G-codes/offsets/tools with .Net

Thanks Tom. Why didn't I think of that far simpler method of transferring values? Anyway, Input Boxes now work, and I've just ticked PC_COMM_MDI off the list, which I think means most of the more complicated PC_COMM commands have now been ticked off the list. At least the ones I need to implement - ...
by Moray
Sat Jan 02, 2021 11:45 pm
Forum: User PC Applications and Libraries .Net
Topic: G-codes/offsets/tools with .Net
Replies: 120
Views: 18641

Re: G-codes/offsets/tools with .Net

I've just been trying this some more, and even if I hard code a value into Persist102, I still get zero, unless I hardcode a big value, such as FFFFFFFF, where I then get a NaN value.

I've even tried using SetPersistDec102, but it still the same.

What am I missing?
by Moray
Sat Jan 02, 2021 8:12 pm
Forum: User PC Applications and Libraries .Net
Topic: G-codes/offsets/tools with .Net
Replies: 120
Views: 18641

Re: G-codes/offsets/tools with .Net

Tom, I'm nearly there with input boxes, but I can't seem to transfer the value back to the KFlop. This is my test KFlop code- #include "KMotionDef.h" #define TMP 10 // which spare persist to use to transfer data #include "KFLOPToKMotionCNCFunctions.c" float inputResult; void main() { //DoPCFloat(PC_...
by Moray
Sat Jan 02, 2021 6:18 pm
Forum: Bug Reports
Topic: InputBox previous value if invalid entry entered
Replies: 1
Views: 328

InputBox previous value if invalid entry entered

I was just doing some testing with a KFlop triggered InputBox, and have just realised if you enter an invalid value, although KMotionCNC pops up another message box saying you've entered an invalid value, it will return the previously valid inputbox value, and return a value of 0, telling the KFlop ...
by Moray
Thu Dec 31, 2020 6:14 pm
Forum: User PC Applications and Libraries .Net
Topic: G-codes/offsets/tools with .Net
Replies: 120
Views: 18641

Re: G-codes/offsets/tools with .Net

Thanks Tom, that has fixed the problem.


C# generally handles strings poorly.
I've got to admit I never knew what a zero terminator was, but having reminded myself how to watch variables in Visual Studio, the \0 is blatantly obvious.
by Moray
Wed Dec 30, 2020 10:15 pm
Forum: User PC Applications and Libraries .Net
Topic: G-codes/offsets/tools with .Net
Replies: 120
Views: 18641

Re: G-codes/offsets/tools with .Net

Tom, that conversion works well, however it seems to produce a string I can't add anything to, and I'm not even sure how to diagnose the problem. What I'm trying to do, is for the button options no longer supported, is add extra lines to the messagebox text, advising the options no longer work, and ...
by Moray
Tue Dec 29, 2020 11:15 pm
Forum: Configuration Issues
Topic: C program control issues
Replies: 18
Views: 669

Re: C program control issues

You use the printf() function to output to the console, however you need to know what kind of number you want to display. For a double/float, you need to use- double x = 89.89; printf("This is a double:%f",x); If you're outputting an integer- int x = 99; printf("This is an integer:%d",x); Then you c...
by Moray
Tue Dec 29, 2020 7:46 pm
Forum: User PC Applications and Libraries .Net
Topic: G-codes/offsets/tools with .Net
Replies: 120
Views: 18641

Re: G-codes/offsets/tools with .Net

Thanks Tom. That was far less painful than I thought it would be. I may have to actually learn the whole bit/byte bashing thing at some point, as it's something I have only a very vague recollection off covering many years ago. MsgBox.png Next step will be working out to implement the icons in a sim...
by Moray
Tue Dec 29, 2020 5:06 pm
Forum: Configuration Issues
Topic: C program control issues
Replies: 18
Views: 669

Re: C program control issues

The motor is responding to the program now, but only in a very limited way. It seems (largely at least) to ignore the speed and direction settings set in the program for whatever reason! The original speed setting was way too fast for getting things set up and working correctly so I reduced it. Sti...