Messed up program access

Moderators: TomKerekes, dynomotion

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Messed up program access

Post by Scott Pancheau » Mon Dec 30, 2019 12:29 am

I have a two axis lathe that Tom K helped me get running correctly including Mach 3 Turn. The Mach homing buttons did not work and Tom sent me the information to fix that. I did it wrong and neither Mach or Kmotion would work right. I reloaded Mach and then the 435b download. Before I re-downloaded the 435 I saved the previous download to documents thinking I would then have a copy of any changes Tom may have made. I now wonder if that is messing up the way the Dynomotion is trying to access the various programs. The error messages I get now are -CSS jog persist undeclared. My spindle deffs unrecognized file type. Simp;e home index Chan undeclared. Init 3 analog lathe My spindle deffs not found. Init button in KMotion Error compiling and loading KMotion program. I have looked at the programs and i believe they are the same as modified by Tom. I have found that if I delete the parts of main init program that are showing the errors I can then do the compile and run and it initializes KMotion CNC and I can run G code programs correctly without spindle control. What I delete is the call for spindle deffs, CSSjog, and Service CSS(); I am including a few shots of the settings and the errors. Thanks for any help.
Scott
Attachments
Capture Tool setup buttons by tom k.PNG
Capture Init C call button setting 12-25-19.PNG
Capture Errant Spindle deffs 12-25-19.PNG
Capture Errant main program 12-25-19.PNG

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

Re: Messed up program access

Post by TomKerekes » Mon Dec 30, 2019 2:55 am

Hi Scott,

I think your C Programs should all be in your C:\CNCLathe folder. Did you lose that folder? From the file not found error it seems it is missing.

The Initialization C Program is: C:\CNCLathe\Init3AnalogLathe.c

Instead you seem to be trying to compile C:\KMotion435b\C Programs\CNCLathe.c ??

Note when a C Program includes other files you must compile the top level C Program. You can not compile the included files by themselves.

It would be helpful to also post the C Programs (tagged as </> code) or attach them to the post.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Re: Messed up program access

Post by Scott Pancheau » Tue Dec 31, 2019 10:58 pm

Thank you for replying Tom and for clarifying that only the main program should be compiled. I think you are correct about losing the folder. I typed the C:\CNCLathe in the search bar within Dynomotion C programs and it was not found. I have included two shots of what I think is supposed to be in a file named thus. If you look at these and think they are what is needed, then do I "Save as in operating system with the C:\CNCLathe name?" The attachment that I had in last post with the wrong axis reference for the spindle was an accident. I am not trying to compile that. Sorry for that additional confusion.I don't know what you mean by posting C programs (tagged as <\> code) can you elaborated on the description please.
Thank You
Scott
Attachments
Capture  Within CSS in CNCLathe  12-19.PNG
Capture  CNCLathe files 12-19.PNG

Moray
Posts: 191
Joined: Thu Apr 26, 2018 10:16 pm

Re: Messed up program access

Post by Moray » Tue Dec 31, 2019 11:09 pm

I think all you need to do, is within KMotionCNC Tool Setup, go to the User Button tab, then rather than typing in the file location, click the button to the right of the text box (one with the ">"), navigate to those files (you may want to move them to a new folder elsewhere first),and select the relevant file.


Actually, as you're using Mach3, you don't want to be using KMotionCNC at all.
All the setup should be done via the plugin within Mach3, unless you want to use KMotionCNC instead.

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Re: Messed up program access

Post by Scott Pancheau » Tue Dec 31, 2019 11:48 pm

Thanks Moray,
I am not sure these are the right files and you are talking to a real sloooow learner. I do want to use mach 3 turn for the wizards and threading but also want to retain usage of KMotion and the many g code programs I have saved for use therein. Are you saying that I cannot use both? When you say I may want to move the programs to another file first, can you tell me what would be an appropriate file to move them to?
Thanks again,
Scott

Moray
Posts: 191
Joined: Thu Apr 26, 2018 10:16 pm

Re: Messed up program access

Post by Moray » Wed Jan 01, 2020 12:12 am

If you want to use both, you can, it's just I was a bit confused as to why you mentioned Mach3, and had screenshots of KMotionCNC.

We'll concentrate on KMotionCNC first.
By copy the files, I mean you may want to copy them to another folder/directory. You don't have to, it's just I prefer to keep everything within the C Program directory within the KMotion installation folder (should C:/KMotion4.3xx/C Programs), and I'll normally create a new folder within that for each machine.
It just means everything is kept close together.

It's worth mentioning that you can delete/ignore the .out files, as they get (re)created automatically by the KMotion compiler when needed.

Once the files are somewhere you're happy with, go into the KMotionCNC Tool Setup as per my previous post, and set the files for Init, and Homing.
I'm guessing CNCLathe.c is your init file, and HomeLathe.c is your KMotionCNC homing file.

I've also just noticed the includes in the screenshot of CNCLathe.c.
I think for simplicity, the easiest option will be to copy the contents of the CSS folder, to the same folder as your other files.
Then you can simply use -

Code: Select all

#include "MySpindleDefs.h"
#include "CSSJog.c"
instead of having to write the complete path to where the files are stored, as you currently are.

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

Re: Messed up program access

Post by TomKerekes » Wed Jan 01, 2020 2:17 am

Hi Scott,

Use Windows File Explorer and navigate to the C: and check if the CNCLathe folder is still there or has been deleted.

Moray suggests putting all the files into the installation directory and there are some benefits of doing this, but my preference is to put them outside the installation directory into your C:\CNCLathe folder to keep them separate. When I worked with you I put all the files there and made all the references to there so if you don't keep that approach you will need to make some changes.

I think I was wrong and the Init C Program we named CNCLathe.c not InitAnalog lathe.c as I said and thought earlier.

If (and only if) the CNCLathe folder doesn't exist I would suggest you:

#1 create a folder C:\CNCLathe
#2 copy all files and folders from your backup CNC Lathe_NOV 2019 to it
#3 change KMotionCNC User Button INIT to reference C:\CNCLathe\CNCLathe.c
#4 also open C:\CNCLathe\CNCLathe.c in KMotion.exe and check if it compiles with no errors

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Re: Messed up program access

Post by Scott Pancheau » Thu Jan 02, 2020 2:24 pm

Thank you Moray and Tom for your help. I think I made some progress, but still not quite there. I did not find the correct file. I went to operating system and opened a new file. I named the file CNCLathe and moved the programs into it from the backup file. Went to KMotion CNC and changed the user button for init to the C:\CNCLathe\CNCLathe.C Went to config screen and opened the C program window. Opened the C:\ CNCLathe\CNCLathe.C and it does now compile. Now have a new error on KMotion CNC intit. button. I have attached the shot of this.
Thanks,
Scott
Attachments
Capture KMotion CNC init button error 1-1-19.PNG
Capture Init program 1-1-19.PNG
Capture  Init button in tool setup 1-1-19.PNG

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

Re: Messed up program access

Post by TomKerekes » Thu Jan 02, 2020 6:58 pm

Hi Scott,
I did not find the correct file. I went to operating system and opened a new file. I named the file CNCLathe and moved the programs into it from the backup file.
I think that was correct, but you are using some wrong terminology. Files and folders are different things. Folders can contain files and sub folders. Files cannot. Sometimes Folders are referred to as Directories. I often mistakenly refer to them as Directories instead of Folders.

"Moving" and "Copying" are also two different things. Moving deletes the files/folders from the original location. Copying does not. I think that was what got you in trouble in the first place. Maybe when backing up the folder you moved the files rather than making a copy.

The "unknown extension type" error is because the Compiler expects a .c extension (lower case) rather than a .C (upper case). Change:
c:\CNCLathe\CNCLathe.C

to
C:\CNCLathe\CNCLathe.c

Also be careful with regard to spaces, they often matter.

Note If you had a backup of the "C:\KMotion435b\KMotion\Data" folder you could have restored the entire contents of this folder. Then you wouldn't have had to re-enter all your KMotionCNC | Tool Setup Settings.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Re: Messed up program access

Post by Scott Pancheau » Thu Jan 02, 2020 7:07 pm

Thank you Tom for your extreme patience. I did mean folder and will try to do better in that regard. You answered a question I have had but not asked in regard to spaces and capitalization. I understand now they must be exact. I will try my luck again tonight when I am home again.
Thank YOU,
Scott

Post Reply