kflop with snapamps - Page 9


Page 9 of 9 FirstFirst ... 6789
Results 161 to 169 of 169

Thread: kflop with snapamps

  1. #161
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default 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

    Regards
    TK http://dynomotion.com


  2. #162
    Registered
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    97
    Downloads
    0
    Uploads
    0

    Default 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

    Attached Files Attached Files


  3. #163
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default 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

    Regards
    TK http://dynomotion.com


  4. #164
    Registered
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    97
    Downloads
    0
    Uploads
    0

    Default 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
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default 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

    Regards
    TK http://dynomotion.com


  6. #166
    Registered
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    97
    Downloads
    0
    Uploads
    0

    Default 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

    Attached Thumbnails Attached Thumbnails kflop with snapamps-untitled-jpg  


  7. #167
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default 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

    Regards
    TK http://dynomotion.com


  8. #168
    Registered
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    97
    Downloads
    0
    Uploads
    0

    Default 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
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: kflop with snapamps

    heh heh thanks for the patience.
    Regards

    Regards
    TK http://dynomotion.com


Page 9 of 9 FirstFirst ... 6789

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

kflop with snapamps

kflop with snapamps