Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: gmankev on April 05, 2018, 07:44:11 AM

Title: VB / LUA evaluation- no license key
Post by: gmankev on April 05, 2018, 07:44:11 AM
I want to develop some customization for my router setup. So that means MACH4 with LUA or MACH3 with VB. I am unsure which and wanted to try both before comitting.

Is there a list of restrictions - I know some - 500 line limit, no THC in plasma.

Will MACH3 allow me to run VB macros without a license ?

 I tried some M6 tool changes and the pop up AskTextQuestion or msgBox to M6Start.m1s  I added do not appear to pop up .. but MACH did stop and Cycle Start button continued the program. 

I also noticed I could not add the tool change position to the GUI . 
 
I did get notified of some errors too, which I corrected - but still no execution of the VB lines.
Title: Re: VB / LUA evaluation- no license key
Post by: TPS on April 05, 2018, 08:03:16 AM
Mach3 will run VB in demo.

post your code, and we will see.
Title: Re: VB / LUA evaluation- no license key
Post by: ger21 on April 05, 2018, 08:45:32 AM
How do you have tool changes in General Config? That has an effect on which M6 macros run.
Title: Re: VB / LUA evaluation- no license key
Post by: joeaverage on April 05, 2018, 02:38:06 PM
Hi,
likewise Lua runs, in fact Mach4 is fully configured in Demo mode. It will run for about 6 minutes before it needs to be reset.

THC is enacted by the motion controller not Mach and to my knowledge Vital Systems Hicon board is the only Mach4 controller that has THC support
at the moment. Warp9's ESS board has most of the code needed for THC but is not ready yet, we've been waiting a year for it.

Craig
Title: Re: VB / LUA evaluation- no license key
Post by: gmankev on April 05, 2018, 06:43:00 PM
Thanks for the confirmation..

I found my macro files had a mix of UNIX and windows line endings.. I have been editing a few for a while I note the error is not explicit every time it happened- need to back track and fix my line endings.

Settings has Tool change pos of 0,0,0  which I cant appear to edit..

In General Config 'Tool Change' is 'Stop Spindle wait for cycle start'

I was trying to see if some popup would appear as part of the MACRO M6Start.m1s. However nothing appears. And program continues when I press cycle start.



tool = GetSelectedTool()
Dim UsersName As String
UsersName = AskTextQuestion(“Please enter your name:”)
Message Please change tool now, “ & UsersName & “!”
MsgBox “Current tool at start of change is “    & GetSelectedTool()
SetCurrentTool( tool )


Title: Re: VB / LUA evaluation- no license key
Post by: joeaverage on April 05, 2018, 07:11:26 PM
Hi,
I personally found that VB was troublesome in that errors were not consistent. It was that inconsistency
that induced me to go to Mach4, I mean if I'm going to learn something new it might as well be the
best for addressing my current and future needs, ie Mach4/Lua.

Craig
Title: Re: VB / LUA evaluation- no license key
Post by: ger21 on April 05, 2018, 07:36:23 PM
Are you sure you are editing the right macro? Meaning in the correct folder?

I haven't had any issues with VB macros like Craig is talking about, and have a few thousand people using the macros in my screenset.   ;)
Title: Re: VB / LUA evaluation- no license key
Post by: joeaverage on April 05, 2018, 08:53:35 PM
Hi,
I should perhaps explain a little better, it rather sounds like my comment indicated that VB doesn't work or work well.
That is not the case, as ger21 points out he has many VB scripts working well.

I was at that time still using Mach3 and just starting to write my own scripts. There are a number of things which I found frustrating,
the apparent plethora of 'standard means' of addressing Mach variables, inconsistent syntax conventions within CE and what I
still regard as a poor mechanism for repeating scripts, aka the macro pump.

While some of these gripes are in fact nothing to do with VB, they  combined meant a frustrating experience trying to generate
code. They could and probably should be regarded as 'learning pains' rather than any true fault.

Given that I already had a Mach4 licence I decided that it made sense to invest the learning effort in Mach4/Lua as it is a better
fit with future needs. I must point out the the learning curve of Mach4/Lua is worse than Mach3/CE. The results however
are a quatum leap ahead. If you are a reluctant programmer stay away from Mach4, if however you like a programming challenge
then Mach4 is just the ticket.

Craig
Title: Re: VB / LUA evaluation- no license key
Post by: TPS on April 06, 2018, 02:18:51 AM

In General Config 'Tool Change' is 'Stop Spindle wait for cycle start'


you have to enable Auto Tool Changer, then M6Start and M6End will be executed.
Title: Re: VB / LUA evaluation- no license key
Post by: ger21 on April 06, 2018, 06:37:15 AM

you have to enable Auto Tool Changer, then M6Start and M6End will be executed.

That's not correct.

Stop Spindle, wait for cycle start will run M6 Start, then M6End AFTER Cycle Start.

Automatic Toolchanger runs M6Start Only.

Ignore tool changes runs no macros.
Title: Re: VB / LUA evaluation- no license key
Post by: TPS on April 06, 2018, 08:45:35 AM
ok ,sorry.
Title: Re: VB / LUA evaluation- no license key
Post by: gmankev on April 06, 2018, 10:03:16 AM
Pretty sure I am in correct directory - get syntax errors with syntax errors infile and none when I remove them.

I parked this problem for a bit - glad to hear the feedback  on LUA and MACH4, might move towards there.
Title: Re: VB / LUA evaluation- no license key
Post by: TPS on April 06, 2018, 10:41:47 AM
i have tested this code here:

Code: [Select]
tool = GetSelectedTool()
Dim UsersName As String
UsersName = AskTextQuestion("Please enter your name:")
Message "Please change tool now" & UsersName & "!"
MsgBox "Current tool at start of change is "    & GetSelectedTool()
SetCurrentTool( tool )

run fine.

post a copy of your M6Start as an attachment, probably there are characters you do not see
in a normal text Editor.