Hello Guest it is March 28, 2024, 02:23:56 PM

Author Topic: Button Reprogramming...  (Read 6330 times)

0 Members and 1 Guest are viewing this topic.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Button Reprogramming...
« Reply #10 on: April 03, 2014, 08:55:40 AM »
Hmm, getting in a mess now (got backup copy though)

I have added the codes dooembutton(1007) zero all
and dooembutton(160) regen toolppath

but now it zeros the dro's then regens the path but then sends the dro's back to somewhere else leaving them non-zero?

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Button Reprogramming...
« Reply #11 on: April 03, 2014, 09:16:22 AM »
It puts the DRO values back to exactly where they were before pressing the button.

i.e. its not storing them.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Button Reprogramming...
« Reply #12 on: April 03, 2014, 09:18:03 AM »
You really want a pause between calls
Sleep 500
would give you 1/2 second delay between calls.


Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Button Reprogramming...
« Reply #13 on: April 03, 2014, 09:27:04 AM »
BTW are you doing it via code in the screen designer?
If so are you able to do multiple lines? If not then likely that is your issue, doing it in a VB button would be best.
Hood

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Button Reprogramming...
« Reply #14 on: April 03, 2014, 09:31:30 AM »
I will add the sleep command

Once I added the script in machscreen, it saved a custom macro, I can now edit that macro with notepad :)

Machscreen is a very "odd" program ;)

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Button Reprogramming...
« Reply #15 on: April 03, 2014, 09:39:26 AM »
That fixed it, it seems that although it creates a macro file it does not use it but instead embeds the code?

Anyway its working nicely now

Thanks all

Offline mbele

*
  •  58 58
    • View Profile
Re: Button Reprogramming...
« Reply #16 on: April 03, 2014, 09:47:28 AM »
You're right, I've tested it, and it seems that it behaves weird. Anyhow, here's the script that works for me:
SetOEMDRO(800,0)
SetOEMDRO(801,0)
SetOEMDRO(802,0)
It will automaticaly regenerate toolpath.
I think that when DROs are defined as "standard" (codes 0,1,2) path will not be regenerated by default.
(jog follow must be turned on, i think)

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: Button Reprogramming...
« Reply #17 on: April 03, 2014, 10:01:50 AM »
That's good, at least two ways of doing it then :)