586,594 active members*
3,002 visitors online*
Register for free
Login
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Posts
    35

    Accessing S Value with Kflop C Program

    Hi Tom

    I was able to successfully connect a VFD to RS232 and control my spindle with c programs.

    Even though I found SpindleOnJog.c SpindleCssJog.c and so on I am not able to get the S Value out of KMotionCNC. To test this I set up following:

    wrote an M3.c Program:
    Code:
    main (){
    #define KMVAR PC_COMM_CSS_S
    #define KMVAR1 1 
    
    float speed1 = *(float *)&persist.UserData[KMVAR];
    float speed2 = *(float *)&persist.UserData[113];
    float speed3 = *(float *)&persist.UserData[KMVAR1];
    
    printf("%f \n", speed1);
    printf("%f \n", speed2);
    printf("%f \n", speed3);
    }
    Then I configured this M3.c in KmotionCNC, for M3, Thread 4, Exec/Wait.

    Kmotion is showing a Spindle Speed of 123.0

    The console returns 0.000000 on pressing the M3 Button or executing M3 S123 in maual entry.

    It seams that I don't understand the concept to access those values. Can you help me?


    Regards

    Leo

  2. #2
    Join Date
    May 2006
    Posts
    4047

    Re: Accessing S Value with Kflop C Program

    Hi Leo,

    The configuration for KMotionCNC | Tool Setup | M0-M30 | S is the configuration that will send the speed, not the M3 configuration. Var 113 (defined as KMVAR PC_COMM_CSS_S in PC-DSP.h) is normally used for passing the speed.

    HTH
    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. Accessing tool magazine
    By cossiegaz in forum SIEMENS -> GENERAL
    Replies: 0
    Last Post: 11-14-2014, 12:40 AM
  2. Accessing Macros on Studer S32/Fanuc 21-t
    By marcwdci in forum Fanuc
    Replies: 8
    Last Post: 09-05-2013, 04:18 PM
  3. Accessing the outputs
    By PomeroyB in forum DynaTorch
    Replies: 1
    Last Post: 11-17-2012, 05:30 AM
  4. Accessing IPL
    By fordav11 in forum Mori Seiki lathes
    Replies: 0
    Last Post: 12-18-2011, 05:29 AM
  5. Accessing Software Operator Panel Oi-TC
    By adamant in forum Fanuc
    Replies: 15
    Last Post: 02-26-2011, 07:44 AM

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
  •