1601
General Mach Discussion / Re: Plasma on Mach3 - Randomly Cutting Imperfect Circles
« on: November 20, 2018, 01:54:30 AM »
sounds like backslash or loosing steps.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Option Explicit
Dim Signal_nr As Integer 'gets signal nr from the P-word
Dim Trigger As Integer 'gets the trigger event variant from the Q-word
Dim Input_nr As String 'to combine SIGNAL string with its number from the P-word for the IsActive command
Signal_nr = Param1() 'Get P-value
Trigger = Param2() 'Get the Q-value
Input_nr="INPUT" & Signal_nr 'this one should create a string "SIGNAL#" with the # number from P-word to use as parameter for commands
Select Case Trigger
Case 0 'IMMEDIATE - triggered immediately on the given signal HIGH detection.
SystemWaitFor(Input_nr)
Case 1 'RISING EDGE - triggered immediately on the given signal RISING EDGE
While IsActive(Input_nr)
Wend
SystemWaitFor(Input_nr)
Case 2 'FALLING EDGE - triggered immediately on the given signal FALLING EDGE
While IsActive(Input_nr)
Wend
Case 3 'HIGH - triggered on the detection of the HIGH state of the signal as opt. 0 but waits for the previous move to finish
SystemWaitFor(Input_nr)
While IsMoving()
Wend
Case 4 'LOW - triggered on the detection of the LOW state of the signal as opt. 1 but waits for the previous move to finish
While IsActive(Input_nr)
Wend
While Ismoving()
Wend
End Select
If I could figure out how to attach an image to this post I would include a circuit diagram for the two cases.
I use an output pin to a couple of gates to select which probe I want to use (under Mach3). But that is custom.
Cheers
Roger
Thanks Roger.
I've had a bit of a play ..... I can use the same input but one probe requires a HI signal and the other a LO, so as it stands now, I still have to change the configuration in Mach 3 each time I change probes.
Instead of a gate or a relay , I was thinking of using a changeover switch, but I still have the other problem to overcome yet.
Steve