Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 05:38:26 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  SystemWaitFor help... Need Mach to wait for a signal!
Pages: 1   Go Down
Print
Author Topic: SystemWaitFor help... Need Mach to wait for a signal!  (Read 320 times)
0 Members and 2 Guests are viewing this topic.
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« on: March 07, 2011, 01:17:13 PM »

Hey guys, embarking on another fun Mach project and I've hit a snag.

The system is going to be a pick, place and solder machine with integrated dispensing of adhesive and solder paste.  I'm trying to use Mach to control the motion and a PLC to control the actuators and timing for the pick/place/solder head.

I've tried writing a macro that does the following:
1)turns on a Mach3 output that enables the PLC
2)waits until a PLC output triggers a Mach3 input before motion can continue

here is said macro:
 
ActivateSignal(output1)   'triggers PLC to start PICK cycle
Sleep(100)
DeactivateSignal(output1)
SystemWaitFor(input1)    'PLC program is complete, Mach may continue


So far everything works, Mach moves the system to its specified coordinates, the halts and the PLC program executes, however when it is complete, the system is stopped.  I can see input 1 being triggered on the diagnostics page but the macro never completes.  Am I executing the systemwaitfor command improperly?

Any suggestions or ideas are more than welcome!

Logged

Mr. Creosote
Overloaded
Global Moderator
*
Offline Offline

Posts: 3,072



View Profile
« Reply #1 on: March 07, 2011, 02:04:04 PM »

ActivateSignal(output1)   'triggers PLC to start PICK cycle
Sleep(100)
DeactivateSignal(output1)
SystemWaitFor(input1)    'PLC program is complete, Mach may continue
DoOEMButton 1000

Might put this at the end and try it.
« Last Edit: March 07, 2011, 02:07:45 PM by Overloaded » Logged

"I haven't failed. I've just found 10,000 ways that won't work."         Edison

"You cannot help men permanently by doing for them what they could and should do for themselves."
Abe Lincoln
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« Reply #2 on: March 07, 2011, 03:14:46 PM »

That did do it!  Also found that manually pressing the start button allowed it to continue.  This is much better though as I want this machine to run with as little operator input as possible.

Also I figured out a work around macro;

ActivateSignal(output1) 'triggers PLC to start PICK cycle
While IsActive(input1)
Wend
DeActivateSignal(output1)

This works the same as the previous script as long as input1 is set to active low!
Logged

Mr. Creosote
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!