![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| CamSoft Products Discuss Camsoft PC based CNC controller products here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#2
| |||
| |||
| ' 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
| ||||
| ||||
| 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
| |||
| |||
| 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) |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New Machine Build- CNC First timer, a little help? | TheMobster | DIY-CNC Router Table Machines | 18 | 06-17-2009 11:41 PM |
| V21 first timer | mmachining | BobCad-Cam | 12 | 07-10-2007 05:36 AM |
| First timer | jpitty | DIY-CNC Router Table Machines | 2 | 02-20-2007 10:38 PM |
| Timer.fil How much is to much ? | murphy625 | CamSoft Products | 10 | 04-04-2005 03:32 PM |