585,582 active members*
4,566 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > starting my C program, any guidance would be appreciated.
Page 1 of 11 123
Results 1 to 20 of 215
  1. #1

    starting my C program, any guidance would be appreciated.

    I have my initialization C program, after tuning the servos, for my axis done. Is defining each of the I/O all I need to in order to run G code?

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    Hi Gunmachinist,

    I'm not sure what you mean by: "defining each of the I/O"

    It depends on what devices you have in your system and how are they controlled.

    Normally to run KMotionCNC you would assign a User INIT button to the initialization C Program.

    Then configure all your MCodes.

    Then configure all of the Trajectory Planner Settings. See here and here.

    HTH
    TK
    http://dynomotion.com

  3. #3

    Re: starting my C program, any guidance would be apreciated.

    Thinking I would need to add my limit switch I/O to my ini. C program for them to work.
    Like:
    int LimitSwitchNegBit; // Neg Limit I/O Bit number
    int LimitSwitchPosBit; // Pos Limit I/O Bit number

  4. #4
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    Configure them using the Configuration Screen as described here.

    The export to your C Program as described here.
    TK
    http://dynomotion.com

  5. #5

    Re: starting my C program, any guidance would be apreciated.

    I have been working with KMotionCNC in the Tool Setup Screen (M0 - M30). I've been able to get the spendle working CW/CCW/stop but am having trouble with how to get my axis working while running g code. My init. C program was done but the axis and most g-code telling the axis to m ove will not work, what am I missing?

  6. #6
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    How have you configured M0-M30 ?

    What is the GCode that doesn't work?

    Post your Init Program.
    TK
    http://dynomotion.com

  7. #7

    Re: starting my C program, any guidance would be apreciated.

    just started attempting to get this mill working but, here is a few screen shots of what I have at this point. I don't understand what the key box is on the User Button page. I know I need to create some C code for the rest of the M codes, or is there a place I can locate existing c code for them?

  8. #8
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    The Key box is for specifying a keyboard shortcut key for the button. See here.

    It seems your INIT C Program isn't enabling the axes. Is it? See here.

    Nothing is configured for the S Action. Do you want to use it to control the Spindle Speed? See here.
    TK
    http://dynomotion.com

  9. #9

    Re: starting my C program, any guidance would be apreciated.

    here is my init file. I'm also having a problem with my limit switch, when they are active my axis will not move unless I manually press the switch.
    Attached Files Attached Files

  10. #10
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    You can change the polarity of limit switches by changing the "Stop when Low" Limit Switch Option as described here.
    TK
    http://dynomotion.com

  11. #11

    Re: starting my C program, any guidance would be apreciated.

    Quote Originally Posted by TomKerekes View Post
    It seems your INIT C Program isn't enabling the axes. Is it? See here.
    int -EnableAxis(0);
    int -EnableAxis(1);
    int -EnableAxis(2);

    int -EnableAxisDest(Z,0);
    int -EnableAxisDest(Y,1);
    int -EnableAxisDest(X,2);

    DefineCoordSystem(0,1,2,-1);

    Not sure how to get it to work, is this headed in the correct direction? If not then how?

  12. #12
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    No that's wrong. The code you posted after I asked was correct. Does it enable the axes?
    TK
    http://dynomotion.com

  13. #13

    Re: starting my C program, any guidance would be apreciated.

    Quote Originally Posted by TomKerekes View Post
    No that's wrong. The code you posted after I asked was correct. Does it enable the axes?
    No. It does not and keeps giving me the error pop up I posted in the screen shot.

  14. #14

    Re: starting my C program, any guidance would be apreciated.

    I have gotten the X and Y axis moving, but when the X axis moves it counts in the screen Z axis. X axis will count like its moving but nothing moves. How do I correct the X axis to make it the X axis?

  15. #15
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    Which axes in KFLOP are your X and Z axes?
    TK
    http://dynomotion.com

  16. #16

    Re: starting my C program, any guidance would be apreciated.

    This what you mean:
    0=Z
    1=Y
    2=Z

  17. #17
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    Is that a typo?
    TK
    http://dynomotion.com

  18. #18

    Re: starting my C program, any guidance would be apreciated.

    Quote Originally Posted by TomKerekes View Post
    Is that a typo?
    Thats where the axis are connected in Kanalog, which is where I have everything connected. Maybe I missed a step where I specified that 0=Z, and 2=X ang just got lucky with Y=1?

  19. #19
    Join Date
    May 2006
    Posts
    4045

    Re: starting my C program, any guidance would be apreciated.

    So you did make a mistake in the previous post? Then code:

    DefineCoordSystem(2,1,0,-1); // define XYZA axes

    instead of

    DefineCoordSystem(0,1,2,-1);
    TK
    http://dynomotion.com

  20. #20

    Re: starting my C program, any guidance would be apreciated.

    Quote Originally Posted by TomKerekes View Post
    So you did make a mistake in the previous post? Then code:

    DefineCoordSystem(2,1,0,-1); // define XYZA axes

    instead of

    DefineCoordSystem(0,1,2,-1);
    That helped get X and Y working correctly, but Z still doesn work. I also tried [DefineCoordSystem(2,1,-1,0); // define XYZA axes] without success. How are the axis supposed to be defined normally?

Page 1 of 11 123

Similar Threads

  1. Starting at New CNC Build -- Guidance Needed!!
    By dtmille2 in forum DIY CNC Router Table Machines
    Replies: 21
    Last Post: 01-02-2013, 05:00 AM
  2. Need some guidance on starting out
    By AlanDv in forum DIY CNC Router Table Machines
    Replies: 2
    Last Post: 08-20-2011, 05:13 AM
  3. starting program
    By chucker in forum Fanuc
    Replies: 2
    Last Post: 11-10-2009, 07:28 PM
  4. Starting program in fanuc 6m
    By Bolle_Ma in forum Fanuc
    Replies: 4
    Last Post: 10-17-2008, 09:11 AM
  5. Starting knee-mill retrofit. Your input appreciated.
    By jamma in forum Uncategorised MetalWorking Machines
    Replies: 2
    Last Post: 03-01-2007, 05:41 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •