586,538 active members*
3,003 visitors online*
Register for free
Login
Page 9 of 9 789
Results 161 to 169 of 169
  1. #161
    Join Date
    May 2006
    Posts
    4047

    Re: kflop with snapamps

    Hi George,

    There still might be some race condition like deactivating the output and then re-activating it before it had a chance to be detected off.

    Post your GCode, Simple Init program, Mach3 XML configuration, and Mach3 Version you are using and I will test it.

    Regards
    TK
    http://dynomotion.com

  2. #162
    Join Date
    Dec 2009
    Posts
    97

    Re: kflop with snapamps

    Hi Tom
    Here are the files. The Mach version I am using is R3.043.066 and the kmotion is 4.33k

    George

  3. #163
    Join Date
    May 2006
    Posts
    4047

    Re: kflop with snapamps

    Hi George,

    Sorry for the delay but we were having fun at the ATX show

    I actually wasn't able to duplicate the problem on my system (I have a very fast PC might be why), but I think I see a bug in your C code:

    while(ReadBit(48))
    ClearBit(54);

    I think your intent was to clear bit 54 after bit 48 is cleared by mach3. But you are missing a semicolon. So instead the ClearBit(54) is included in the while loop and immediately cleared.

    But regardless I think a better approach is to use a "two wire handshake" for guaranteed synchronization rather than using delays and pulses that you expect to be always long enough to be observed. The idea works like this: Imagine person A wants to signal person B to do something and wants to know when they have completed. Each person has one flag and they are both down initially. To signal the steps are:

    #1 - A puts up his flag and waits to see B has raised his flag
    #2 - when B sees A put his flag up, he performs a task and puts his flag up
    #3 - when A sees B has put his flag up he drops his flag and waits until B puts his flag down
    #4 - when B sees A put his flag down, he drops his flag

    The nice thing about this approach is that no delays or pulse times need to be defined and things progress as fast as the communication allows.

    Here is some code I tried on the KFLOP side:

    Code:
    for(;;)
    {	
        if (ReadBit(48)) // signal from mach3 ?
        {
            Delay_sec(5);  // simulate performing a task
            SetBit(54);    // flag we are done
            while(ReadBit(48));  // wait for mach3 to acknowledge by removing signal
            ClearBit(54); 
        }
    }
    Here is the mach3 side code:


    Code:
    ActivateSignal(Output5) 'Send signal to input bit 48 on
                                 'Kflop to start THC 
                            
    While Not IsActive(Input1)   'Wait for THC to complete.Sent from Kflop,Bit 54
    Wend
    
    DeactivateSignal(Output5)
    
    While IsActive(Input1)   'Wait for THC to complete.Sent from Kflop,Bit 54 to be removed
    Wend
    HTH
    Regards
    TK
    http://dynomotion.com

  4. #164
    Join Date
    Dec 2009
    Posts
    97

    Re: kflop with snapamps

    Hi Tom
    Tried it your way and still doing the same thing. The interesting thing is that I even went as far as just turning on Output 5 nothing else . When the program gets to M03,
    Mach3 freezes without setting the output on. I can see this in the diagnostic screen in Mach. If I step through the program, the output goes high. For fun I disabled the Kflop drivers in mach and set input 1 to a key on the
    keyboard to simulate the feedback from Kflop. Mach works fine. Do you think I should reload mach3 or try with another computer?

    George

  5. #165
    Join Date
    May 2006
    Posts
    4047

    Re: kflop with snapamps

    Hi George,

    Hmmm. There was a Mach3 hang fixed in Version 4.33l (the version after the one you are using). Please update to the latest Released Version 4.33 and see if you still have the problem. The code I tested with had that fix in it and I couldn't see the problem.

    Regards
    TK
    http://dynomotion.com

  6. #166
    Join Date
    Dec 2009
    Posts
    97

    Re: kflop with snapamps

    HI Tom

    Trying to update Kflop. I updated Kflop and rebooted both kflop and computer and I can't connect to kflop.
    See message in att.

    George

  7. #167
    Join Date
    May 2006
    Posts
    4047

    Re: kflop with snapamps

    Hi George,

    Strange. Did the Flash operation complete?

    Try doing the Flash Recovery.

    #1 Power down KFLOP
    #2 Restart KMotion.exe V4.33
    #3 Press Recovery on the Config/Flash Screen
    #4 follow prompts
    #5 if successful Flash "New Version"

    Regards
    TK
    http://dynomotion.com

  8. #168
    Join Date
    Dec 2009
    Posts
    97

    Re: kflop with snapamps

    Hi Tom
    Re flashed and all is working. I/O is responding the why God (and you) intended !!!

    George

  9. #169
    Join Date
    May 2006
    Posts
    4047

    Re: kflop with snapamps

    heh heh thanks for the patience.
    Regards
    TK
    http://dynomotion.com

Page 9 of 9 789

Similar Threads

  1. resolver and kflop
    By turbothis in forum Dynomotion/Kflop/Kanalog
    Replies: 24
    Last Post: 12-25-2015, 01:29 AM
  2. kflop by itself?
    By markymark1 in forum Dynomotion/Kflop/Kanalog
    Replies: 4
    Last Post: 04-20-2014, 07:19 PM
  3. KFlop 4.3
    By John Coloccia in forum Dynomotion/Kflop/Kanalog
    Replies: 3
    Last Post: 05-03-2013, 07:57 PM
  4. Umax Cnc BOB with Kflop...anyone else using this?
    By spank in forum Dynomotion/Kflop/Kanalog
    Replies: 6
    Last Post: 03-12-2013, 08:40 PM
  5. Mach3 vs Kflop
    By MarunovV in forum Dynomotion/Kflop/Kanalog
    Replies: 13
    Last Post: 07-25-2012, 08:54 PM

Posting Permissions

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