Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: M250cnc on January 14, 2010, 11:33:40 AM

Title: MacroPump Doesnt Run
Post by: M250cnc on January 14, 2010, 11:33:40 AM
I have it named MacroPump.1ms

I have the use macro pump box ticked on the Config General Config page

It runs correctly if i open it with the Mach VB script editor

Anyone have any ideas what's wrong ?

Phil
Title: Re: MacroPump Doesnt Run
Post by: zealous on January 14, 2010, 08:37:22 PM
Make sure it is the same folder as your profile name:

If you load "myprofile" it will be in:
C:\Mach3\macros\myprofile\macropump.m1s

Also you have to restart Mach after checking the macropump box.
Title: Re: MacroPump Doesnt Run
Post by: M250cnc on January 15, 2010, 05:38:38 AM
Thanks Jason

It is in the profile folder, & Mach has been restarted.

Is there any other way of checking that its working other than what it is supposed to do ?

Phil
Title: Re: MacroPump Doesnt Run
Post by: zealous on January 15, 2010, 10:57:40 AM
Put this in the Macropump to check:


Code: [Select]
i=i+1
message "Macro Running #"&i

 it will show you in Mach’s statues line how many times the macro has ran.

Title: Re: MacroPump Doesnt Run
Post by: M250cnc on January 15, 2010, 12:01:08 PM
Thanks Jason,

It does run. ;D

It just doesn't like my macro, there are only 4 lines.  ::)

If(GetLED(801)=1)Then
DOOEMBUTTON (1021)
MESSAGE " Went Into Inch Mode"
end if

No laughing. :-[

Phil
Title: Re: MacroPump Doesnt Run
Post by: zealous on January 15, 2010, 12:21:01 PM
You'll need to use "GetOEMLED"... but more important use "True/False":

Code: [Select]
Dim Inch_LED_boolean As Boolean
Dim Inch_LED_interger As Integer

Inch_LED_boolean = GetOEMLED(801)
Inch_LED_interger = GetOEMLED(801)

MsgBox "boolan "&Inch_LED_boolean
MsgBox "Number "&Inch_LED_interger

'Number way
If(Inch_LED_interger = -1)Then
MsgBox "Number lookup"
End If

'Boolean way
If(Inch_LED_boolean = True)Then
MsgBox "boolean lookup"
End If

'Boolean way with out  ==
If(Inch_LED_boolean)Then
End If

'Boolean way with out  ==
If Not(Inch_LED_boolean)Then
End If
Title: Re: MacroPump Doesnt Run
Post by: M250cnc on January 16, 2010, 05:29:25 PM
Jason,

Thanks i got the macropump to work, but now it resets itself and just leaves my message i want it to stay in reset mode.

Obviously VB scripting is not an area where i excel, do i need an else somehow  :-[

Phil
Title: Re: MacroPump Doesnt Run
Post by: zealous on January 16, 2010, 05:47:17 PM
Great,

You can put a sleep in there to clear the message.

Code: [Select]
Dim Inch_LED_boolean As Boolean
Inch_LED_boolean = GetOEMLED(801)
If(Inch_LED_boolean = True)Then
MESSAGE " Went Into Inch Mode"
Sleep(2000)'2 seconds
MESSAGE ""
End If


...you might want to use a userlabel or ticker as well as well.

In Screen4 you'll want to drop a Userlabel or ticker:

Code: [Select]
SetUserLabel 12, "You must enter a whole number of holes"
SetTicker 205, "This is a very long error message because you seem to have done something very silly"

Title: Re: MacroPump Doesnt Run
Post by: M250cnc on January 17, 2010, 11:57:26 AM
Hi Jason,

Thanks for your patience in helping this dummy. :-[

I want the message to stay i just want the event once its happened to leave the machine disabled until i reset the machine.

Is that possible.?

Phil
Title: Re: MacroPump Doesnt Run
Post by: zealous on January 17, 2010, 01:50:06 PM
Hi Phil,

Let me get a better idea of sequence of events.

If the machine goes into Inch mode, no matter what it is doing Estop(reset) the system, send a message about being in Inch mode and wait for a "reset" before removing the message?
Are you using the VB popup message display or the Mach label message display?
Jason
Title: Re: MacroPump Doesnt Run
Post by: M250cnc on January 17, 2010, 04:46:35 PM
Hi Jason,

All correct in your observation and i am using the Mach label message display.

Phil
Title: Re: MacroPump Doesnt Run
Post by: zealous on January 17, 2010, 05:34:59 PM
I give the user 2 seconds to change it to MM after the estop is hit or it estops the sytem again.

Code: [Select]
Dim Inch_mode As Boolean
Dim Estopped As Boolean

Estopped = GetOEMLED(800)
Inch_mode = GetOEMLED(801)

If(Inch_mode)Then

'Is the sytem estopped already
If Not(Estopped)Then
'Estop system
DoOEMButton(1021)

End If

While(GetOEMLED(800))
MESSAGE "Went Into Inch Mode:"&i
sleep(250)
Wend

'Give the user time to change to mm?
Sleep(2000)

End If
Title: Re: MacroPump Doesnt Run
Post by: M250cnc on January 17, 2010, 05:55:37 PM
Hi Jason,

Thank you so much, it beats checking a custom screen with a flashing red led 25mm x 50mm while turning the MPG. ;D

It's so easy when you know how, i would never have got that.

Phil
Title: Re: MacroPump Doesnt Run
Post by: zealous on January 17, 2010, 09:47:43 PM
Great to hear!
I wasn't sure that was what you wanted, but you can make changes and maybe have it force it back to MM mode or something :)
Title: Re: MacroPump Doesnt Run
Post by: M250cnc on January 18, 2010, 10:45:59 AM
Jason,

I can understand the workings, with a bit of thought  :-[, but why fix something that isn't broke. ;D ;D ;D

Phil