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!