Hello Guest it is May 06, 2021, 09:01:34 PM

Author Topic: Comments about Mach4 in Demo  (Read 73449 times)

0 Members and 1 Guest are viewing this topic.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Comments about Mach4 in Demo
« Reply #140 on: May 02, 2014, 12:09:20 PM »
Is there a listing anywhere of the mc.*********x  codes that have been created for MACH4??
Re: Comments about Mach4 in Demo
« Reply #141 on: May 02, 2014, 12:25:06 PM »
MACH Config - Input signals tab - first column is not resizable - text truncated

Don't see it here...

The issue is also present on Axis Mapping, Homing, Input, Output and Spindle tabs.

By 'first column, I refer to the gray colored column that has, for lack of a better term, the 'titles' for each line. This column cannot be resized on my system. Some of the 'titles' exceed the available space and are therefor truncated. In most cases, this is not much of a problem, but some of the titles need to be guessed at, which is not a good thing.

They ALL drag and display properly here, top row as well as columns.
Dell laptop
XP SP3

Russ

I do not understand what I could be doing wrong, then. No matter ho slowly or carefully I float
 the cursor over the vertical line between COLUMN 1 and 2, I do not get the expand cursor as I get with every other vertical line between COLUMNS.

To make sure we are on the same page, I am attaching a screen capture with the first column circled. How do I make this column wider?



My misunderstanding Steve, sorry.
That is the only line that won't move here as well.
But, There is plenty of room, maybe a smaller font than yours ? ?
Stock screen from last Hobby post. (which may not be correct according to smurf's earlier post)

Russ
Re: Comments about Mach4 in Demo
« Reply #142 on: May 02, 2014, 12:29:24 PM »
....well, there IS one that doesn't fit !  :)

Russ
Re: Comments about Mach4 in Demo
« Reply #143 on: May 02, 2014, 12:53:02 PM »

So, with Lua replacing VBscript, how is the above described process handled by MACH4? Specifically, does MACH4 suspend the G-code execution until macros return or will the programmer still have to test and insert delays to assure this happens?

Secondly, will macros be able to have any legal windows file name and be called by a 'RunScript' (or equiv) call?


simpson36,

First I want to explain the main difference between how mach3 handled Mcodes and how mach4 handles Mcodes.  In mach3 every time a Mcode was called from gcode or a RunScript command mach would go find the mcode load that single VB script, compile it and then run it.  So in mach3 every mcode was run on its own thread and the only way to have one mcode pass variables to another mcode was through a DRO, LED ect.

Now lets talk about mach4!!


Andrew, thanks for the info. It does help. However, my original question remain:

1) Does MACH4 wait for a return from a 'function' before it parses the next G-code block.
 - and-
2) Can 'named' (sorry, I don't know what else to call them) scripts residing in legally named Windows files be called from a 'function'.

Here is an example:

'© 2012 www.theCUBEstudio.com
'NAME:       M4011
'ACTION:    Runs script to set Lathe mode ON
'USE:          embedded macro

 
If RunScript("\macros\Simpson\4thAxisModeOFF") < 0 Then
MsgBox "RunScript 4thAxisModeOFF returned an error"
End If


The above 'numbered' macro calls the following 'named' macro:

'© 2012 www.theCUBEstudio.com
'NAME:      4thAxisModeOFF
'ACTION:    Macro to set Axis mode
'USE:       Called From M4011 - embed in Gcode
'NOTE       'unconditionally enables 4th axis   - built from 4thAxisModeSWITCH macro


Style1 = 4 + 32   '4=display Yes and NO buttons only 32 = Question Icon
Style2 = 0 + 48  '0= display OK button only 48=Exclamation Icon

GoFlag = true

DriveDisabled = GetUserLED(1003)
IndexON = GetUserLED(1004)
SpindleON = GetUserLED(1005) + GetUserLED(1006)  'Either Spindle ON CW or CCW will = true
CurrentRPM = GetUserDRO(1003)


' activate Turn MODE


 If (DriveDisabled = 1) Then           ' drive is disabled, enable drive
  If RunScript("\macros\Simpson\4thEnableON") < 0 Then
   MsgBox "RunScript 4thEnableON returned an error"
  End If      
 End If
   SetUserLED(1004,0)            ' Index Mode LED OFF
   SetModOutput(4,1)            ' set INDEX mode OFF thru Modbus
   Sleep(300)
sleep(20)


The larger 'named' macro is in the windows file 'c:\MACH3\macros\Simpson\4thIndexModeOFF.m1s'. The delays are primarily to allow enough time for the Modbus to finish processing. Because of the time involved to execute, this macro is problematic to run directly as an 'M*********' macro because MACH3 would be off and crunching thru the next several G-code blocks before the macro completes.

So, if any of the above makes sense, can anyone either answer the two questions above or perhaps just describe how to duplicate this functionality in MACH4?

Much appreciated!



simpson36,

To try to answer your question.
1. Yes mach will wait for a return before executing the next block
2. You can use named like 4thAxisModeOFF.mcs and then in your M4011 you could call the script with 4thAxisModeOFF().

When you make your scripts make sure you name the script the same name as the function in the script.

Scott - The range is the pulley range, and in mach4 each range has it own accel and decel parameters.

Andrew
MachMotion
« Last Edit: May 02, 2014, 12:54:44 PM by are1987 »
Andrew
MachMotion
Re: Comments about Mach4 in Demo
« Reply #144 on: May 02, 2014, 01:03:55 PM »
Worked on a quick little routine this morning while watching the news.

I like to know the percent of completion the program I am running.


That's really cool Vince Craig. Very neat.
This just shows % of total lines of code irrespective of the actual time it takes for the file to complete, right ?
If so, how difficult would it be to do similar by displaying a running  % of TIME remaining ?

Very interesting, thanks for posting,
Russ
 :)
« Last Edit: May 05, 2014, 11:08:52 AM by Overloaded »

Offline Dan13

*
  •  1,208 1,208
    • View Profile
    • DY Engineering
Re: Comments about Mach4 in Demo
« Reply #145 on: May 02, 2014, 01:44:16 PM »
Worked on a quick little routine this morning while watching the news.

I like to know the percent of completion the program I am running.


That's really cool Vince. Very neat.
This just shows % of total lines of code irrespective of the actual time it takes for the file to complete, right ?
If so, how difficult would it be to do similar by displaying a running  % of TIME remaining ?

Very interesting, thanks for posting,
Russ
 :)


Yes, this is a nice thing. Thanks for sharing, Craig.

But, could we keep this thread strictly for Mach4 bug reports and related comments? And open new threads for other topics. Otherwise the thread is getting cluttered with all sorts of other things and the bugs are getting missed by Brian and Steve and it's not leading to anywhere.

Dan

Online smurph

*
  • *
  •  1,396 1,396
  • "That there... that's an RV."
    • View Profile
Re: Comments about Mach4 in Demo
« Reply #146 on: May 02, 2014, 02:08:31 PM »
Is MACH4 suspended while a SUB is running (as with MACH3 named SUBS) or is it still necessary to insert pauses/delays?

And as long as were on the topic, does MACH4 support named SUBS?

Mach 4 is not suspended.  But I'm not sure what you mean.

And by named subs do you mean the sub file named in the comment?  If so, then Mach 4 supports that.

Steve
Sorry for confusion. I tend to think of macros as subroutines and intermix the terms. 

...



The macros can be named anything.  However, to call one as an M code, it had better start with m!  :)  But inside the scripting environment, you can call a script with any name.

Mach4 syncs on M codes.  The M code may be a macro or it may not (M98 vs. M03, etc..  M codes break the CV chain.  And M codes run to completion before the interpreter advances.

Online smurph

*
  • *
  •  1,396 1,396
  • "That there... that's an RV."
    • View Profile
Re: Comments about Mach4 in Demo
« Reply #147 on: May 02, 2014, 02:13:15 PM »
Asked this before, but it again got missed - is there a way to have the DRO's persistent like it is in Mach3?

Also, a few other things:

1. Are there no settings for CV like there used to be in Mach3?
2. While running a program, all the buttons under the the File Ops tab should be grayed out or at least shouldn't do anything if clicked on, like it is in Mach3. Clicking one of them in Mach3 returns a message that you should first Stop the programme running.
3. Can the file loader be made to remember the last location and not default to the root directory of Mach4?
4.

Dan

1. No CV settings at this time.  CV is now using a much more advanced logic than it did in Mach 3.  For most cases, there is simply no need to tweak it.  However, we may add a setting or two soon.
2. This is controlled entirely by the screen set.  You can make it do whatever you want it to do.
3. I will make the file open "remember".

Online smurph

*
  • *
  •  1,396 1,396
  • "That there... that's an RV."
    • View Profile
Re: Comments about Mach4 in Demo
« Reply #148 on: May 02, 2014, 02:15:47 PM »

3. Can the file loader be made to remember the last location and not default to the root directory of Mach4?
4.

Dan
I'm with Dan on # 3.

Also, G4 .... anywhere to select ms instead of seconds ?
Is decimal seconds a valid entry ?  ie: 0.25

Thanks,
Russ

I believe you can use decimals with G4.

Steve

Online smurph

*
  • *
  •  1,396 1,396
  • "That there... that's an RV."
    • View Profile
Re: Comments about Mach4 in Demo
« Reply #149 on: May 02, 2014, 02:18:39 PM »
Is there a listing anywhere of the mc.*********x  codes that have been created for MACH4??

In the docs folder.  LuaCalls.txt

It is just a list.  We are working on the full documentations.  And there is a LOT of work left to do.

Steve