586,096 active members*
3,798 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    446

    A small quirk with Mcode setup..

    I have this code for a button. Its under an Mcode.

    The problem I am having is that clicking on EXIT MENU does not always exit the listsetup.. Its actually a 50/50 thing.. Sometimes it exits on the first click, sometimes I have to click it 2 or 3 times to get the menu to exit.
    I tried entering the exit coding (red) in different locations but nothing seems to make a difference.
    Any ideas?

    !\8=0
    !:UPDATE1
    !IF \81=0 THEN \9=FREE
    !IF \81=2 THEN \9=BUSY
    !IF \8=EXIT MENU THEN EXIT
    !LISTCLEAR: LISTSETUP 20;5625;2000;2000 :LISTADD STAGE 1 STATUS :LISTADD EXIT MENU :LISTADD TIME LEFT \31 :LISTADD STATUS \9 :LISTADD DWELL \151 :LISTADD DRIP \171 :LISTPICK \8
    !IF \8=EXIT MENU THEN EXIT
    !SLEEP .25
    !IF \8=EXIT MENU THEN EXIT
    !IF \8=0 THEN GOTO :UPDATE1
    -----M1

  2. #2
    Join Date
    Sep 2003
    Posts
    17
    Murphy,

    I got the answer. Next time iam charging

    Simpler was the answer. It was stuck in a loop. I removed all the GOTO and loop logic and the end result is that variable \8 from LISTPICK will be updated correctly even after it finishes. No need to go around in a IF THEN GOTO loop.

    !IF \81=0 THEN \9=FREE
    !IF \81=2 THEN \9=BUSY
    !LISTCLEAR: LISTSETUP 20;5625;2000;2000 :LISTADD STAGE 1 STATUS :LISTADD EXIT MENU :LISTADD TIME LEFT \31 :LISTADD STATUS \9 :LISTADD DWELL \151 :LISTADD DRIP \171 :LISTPICK \8

    The LISTPICK command still works great without the you keep checking and reissuing it over. The simplicity of LISTPICK is it will stay active on the screen forever, even if you go do other things, run other logic and come back hours later , LISTPICK seems as if its waiting for you running in the background ready to store your PICK to variable \8.

    I also separated the commands on separated lines so it reads cleaner.

    !IF \81=0 THEN \9=FREE
    !IF \81=2 THEN \9=BUSY
    !LISTCLEAR
    !LISTSETUP 20;5625;2000;2000
    !LISTADD STAGE 1 STATUS
    !LISTADD EXIT MENU
    !LISTADD TIME LEFT \31
    !LISTADD STATUS \9
    !LISTADD DWELL \151
    !LISTADD DRIP \171
    !LISTPICK \8

    Jim C.

  3. #3
    Join Date
    Nov 2004
    Posts
    446
    Jim,
    Thanks for the help!!! But it doesnt work :nono:

    The menu shows up correctly and displays the values of the variables but the variables do not update. I have to click the button to execute the Mcode to get it to update. One of the variables (\31) is driven by the timer.fil and counts down. I want to be able to watch it count down when the list is open.
    My version, the loop I had going was continuously re-running the mcode for me as if I was clicking on it myself. The problem is that exiting that loop was a 50/50 shot when you clicked on EXIT MENU.

    Any other ideas??
    Murphy

  4. #4
    Join Date
    Sep 2003
    Posts
    17
    Yesterday you didn't update the TIME variable \31 in the code you posted so there was no need to go into a loop. So if it wasn't for the reason that you wanted to update the pop up list box menu for the time then the code I posted yesterday will work very cleanly.

    Instead of the M code from yesterday put this code in the TIMER and also refresh your variables here too.

    !IF \81=0 THEN \9=FREE
    !IF \81=2 THEN \9=BUSY
    !LISTCLEAR: LISTSETUP 20;5625;2000;2000 :LISTADD STAGE 1 STATUS :LISTADD EXIT MENU :LISTADD TIME LEFT \31 :LISTADD STATUS \9 :LISTADD DWELL \151 :LISTADD DRIP \171 :LISTPICK \8

    Jim C.

Similar Threads

  1. Turbo CNC Not Running.... Setup?
    By Davedbq in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 4
    Last Post: 02-04-2005, 08:20 PM
  2. Machinist - CNC Setup & Operator in FLA
    By sundara in forum Employment Opportunity
    Replies: 0
    Last Post: 12-24-2004, 04:35 PM
  3. Setup instruction
    By dgb in forum Uncategorised MetalWorking Machines
    Replies: 1
    Last Post: 09-07-2004, 12:39 AM
  4. Taig CNC ready setup help??
    By efreak in forum Taig Mills / Lathes
    Replies: 2
    Last Post: 08-25-2004, 01:30 AM
  5. How to change the setup sheet format?
    By cwww in forum Uncategorised CAM Discussion
    Replies: 2
    Last Post: 06-30-2004, 08:28 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
  •