Results 1 to 4 of 4

Thread: Timer switch

  1. #1
    Registered
    Join Date
    Oct 2007
    Location
    Belgium
    Posts
    12
    Downloads
    0
    Uploads
    0

    Timer switch

    Hi ,

    I have a cilinder with end switch #83=1 cilinder go left wait until hit switch
    but If there is no air I want an alarm as

    #84=0
    #83=1
    WAITUNTIL #59=1:SLEEP 2:LABEL1 AIR TOO LOW;12:EXIT
    -----M50

    Thanks


  2. #2
    Registered
    Join Date
    Apr 2003
    Location
    United States
    Posts
    290
    Downloads
    0
    Uploads
    0
    ' The following routine checks to see if a prox switch is hit within 500 ms
    ' If not then display a message
    ' Change time 500 ms and I/O relay # as needed
    #83=1 ' Engage air cylinder to start move
    TIME RESETMS ' set millisecond time counter to zero
    LOOP:
    TIME MS;\55 ' read how many milliseconds has elapsed
    IF \55>500 THEN LABEL1 AIR TOO LOW;12:EXIT
    IF #59=0 THEN GOTO :LOOP ' if switch not hit then re-check again
    ' If made it here then switch was hit within 500 ms
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3
    Registered Karl_T's Avatar
    Join Date
    Mar 2004
    Location
    Dassel,MN,USA
    Posts
    1,361
    Downloads
    0
    Uploads
    0
    Hey Camsoft,

    I'm just curious. I would have included a SLEEP 0.025 right after the LOOP: line. The way this code is written the loop will run many 10000s of times in the time it takes to make the cylinder prox switch. My concern is this could bring the 'puter to its knees and affect something else that might be going on in inputio, limitio, or elsewhere. Sleeping for a few miliseconds really frees up computer resources. Is this at all necessary?

    Karl


  4. #4
    Registered
    Join Date
    Apr 2003
    Location
    United States
    Posts
    290
    Downloads
    0
    Uploads
    0
    Karl,

    Putting a SLEEP in there is okay for the reason you mentioned but if you think about it, it maybe sleeping when the I/O switch is hit. If the relay was only on/off briefly it may miss it.

    Tech Support
    CamSoft Corp.
    951-674-8100
    support@camsoftcorp.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


Similar Threads

  1. New Machine Build- CNC First timer, a little help?
    By TheMobster in forum DIY CNC Router Table Machines
    Replies: 18
    Last Post: 06-18-2009, 12:41 AM
  2. V21 first timer
    By mmachining in forum BobCad-Cam
    Replies: 12
    Last Post: 07-10-2007, 06:36 AM
  3. First timer
    By jpitty in forum DIY CNC Router Table Machines
    Replies: 2
    Last Post: 02-20-2007, 11:38 PM
  4. Timer.fil How much is to much ?
    By murphy625 in forum CamSoft Products
    Replies: 10
    Last Post: 04-04-2005, 04:32 PM

Posting Permissions


 


About CNCzone.com

    We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

Follow us on

Facebook Dribbble RSS Feed


Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.