Hello Guest it is April 19, 2024, 05:26:46 AM

Show Posts

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.


Messages - TPS

11
G-Code, CAD, and CAM discussions / Re: Mach4 Lathe weird toolpath
« on: February 01, 2024, 11:11:18 AM »
somewhere in cofigation general you can switch IJ Mode absulute and incremental

12
for test place three simple Led's on your screen (1500,1501,1503)
to see the status of those three led's.
then you can witch is true or false.

13
so it looks like UserLed(1500) is false if you push the buttom

in this case If condition should look like this:
Code: [Select]
If ((GetUserLed(1500) = False) And (GetUserLed(1501) = True))  Then

14
if you go to

Operator -> Brain Control -> select your Brain -> view Brain

can you see the branch getting green when you press the external start button?

have you restarted Mach3 after you added code to macropump?
you have to do this every time you change macropump script.

add for test this code:
Code: [Select]
msgbox("i was here")
to macropump to chech that it's running.




15
i would use oemcode(34) -> basic script
then in basic script window

Code: [Select]
SetUserLed(1503,1)

and then in macropump.m1s
Code: [Select]
If ((GetUserLed(1500) = True) And (GetUserLed(1501) = False)) Or (GetUserLed(1503) = True) Then
'insert your button code here
'.
'.

'Start machine
DoOEMButton(1000)
End If
'make sure we run the code only one
SetUserLED(1501,GetUserLed(1500))
SetUserLED(1503,0)

16
now i got you, you will have to use a seperate UserLed because brain will overwrite UserLed(1500).

17
ok, the example code i posted has to be in macropump.m1s witch is located in your
macro folder. normaly C:\Mach3\macros\'your profile name'

this macro is running automaticly cyclic if it is enabled in Config->General Config->Run Macro Pump

as soon as enabled and Mach3 is up it will "look" cyclic for UserLed(1500) and as it becomes
true the code witch is in the If Then EndIf will be excecuted.

your brain will only read modbus input (your external start button) and the set UserLed(1500) true
when the button is pressed. you have nothing to do in your screenset, except copying the code from
start button into the macropump macro.   

18
in standard 1024 screenset this small led ring arround the button is assigned to OEMled(804)
witch is the program start LED.

so if you assign it to OEMLed(1500), witch is only a onoe to one copy of your modbus input,
it will only light green as long you press your extrenal start button and will not show that programm
is running.

19
the LED (green frame arround start button) will come up automaticly when programm is running.

20
you can copy your code from Start Button into macropump 1 to 1.

example for macropump.m1s:
Code: [Select]
If ((GetUserLed(1500) = True) And (GetUserLed(1501) = False)) Then
'insert your button code here
'.
'.

'Start machine
DoOEMButton(1000)
End If
'make sure we run the code only one
SetUserLED(1501,GetUserLed(1500))


then modify your brain that the modbus input set's UserLed(1500)
and make sure macropump is enabled in Config->General Config