Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: cncman172 on November 17, 2016, 12:57:11 PM

Title: MACH4 Profiles
Post by: cncman172 on November 17, 2016, 12:57:11 PM
Quick question on Mach4 profiles.

I used the MACH4 loader and had it copy Mach4mill and created a new version that I could test new LUA code.  I had lots of that code working but decided I wanted to work on a plugin that was causing issues, which was the POKEYS plugin.  I decided to help the Polab troubleshoot the issue I would go back to the unmodified version of Mach4mill and created another profile that copied Mach4mill and used that version to make changes in the LUA code.  Today I wanted to go back to my previous version which had lots of working LUA code and when I did all the LUA code was gone, it was back to the the code that came standard in Mach4mill.  My understanding is that profiles copied all the changes you made to the WX4 screen and kept all that code in the profile directory.  When I was using the profile for Pokeys it only had a few lines of LUA code, buy my RussMill profile had everything.  It seems like the Profile does not save all the LUA code in Screen Load, PLC, etc.


Anyone else seen this happen?  Good thing I can copied all of this stuff and pasted it to a Word document so at least I can get working code back by pasting the LUA back into a new profile.

Russ
Title: Re: MACH4 Profiles
Post by: Chaoticone on November 17, 2016, 01:58:39 PM
Your profile keeps all of the configuration settings. However, script changes made to screens are saved to the screens, not the profile. Any time any element is customized (profiles, screens, macros, etc.) they should be saved as something unique. So in short, the first thing you should have done when you went to edit the screen is save it as something unique and made your edits to it............ just the same as you did for the profile.
Title: Re: MACH4 Profiles
Post by: cncman172 on November 17, 2016, 02:03:58 PM
Steve,

Thanks.  Now when I use say WX4 when I load the new profile, how do I go about doing the screen save which contains all the scripts.  Do I maybe rename WX4 to something like WX4-custom?

Russ
Title: Re: MACH4 Profiles
Post by: Steve Stallings on November 17, 2016, 02:33:33 PM
If you use the packaged profile function at  Help > Support > Package Current Profile
then the screen set and other items such as LUA scripts, tool tables, and some other
INI files get saved. The resulting file is given an extension type of .M4PROF but it is
actually an ordinary ZIP file and can be opened as such if you change the extension
of the file name.

You get it all back by using the Mach4Loader to "import" the packaged profile.

Steve Stallings
www.PMDX.com
Title: Re: MACH4 Profiles
Post by: cncman172 on November 17, 2016, 03:07:57 PM
Steve,

But, that is exactly what I used.  The Mach4Loader asked if I wanted to create a new profile so I did, made a bunch of changes it that always seemed to work fine.  Each time I loaded using the loader I got all the code back exactly the way it was before I used it the last time.  When I created another profile it was again the mill profile copied into a new name, Mach4 loader created it I just provided the name.  But when I tried to go back to the profile that had all the screen code that profile was now back to just the default version of Mach4mill, all my changes were gone.

I looked in all the directories that have the different profiles and I can not find a file with extension .M4PROF are they maybe hidden files?

Thanks for your help, still working to understand how all of this works.  I have been playing with MACH4 about six months and know how to do a good deal of things and have things working but need to understand how to avoid losing all my effort as I code stuff to make my machine work correctly.  Thanks again.

Russ

Title: Re: MACH4 Profiles
Post by: DazTheGas on November 17, 2016, 03:55:52 PM
This should help, watch this video from 5:30 to 8:00 on setting up a profile from scratch.

DazTheGas
Title: Re: MACH4 Profiles
Post by: Fledermaus on November 17, 2016, 04:02:35 PM

But, that is exactly what I used.  T

It sounds from your description that you created a new profile. However, this is not the same as packaging your existing profile, which as Steve says, you do using Help > Support > Package Current Profile. Please also note that this package contains most items that you can modify but it does not save modules, so if you have modified any modules, be sure to save these as well, as they will otherwise be lost when you update Mach4.

Allan
Title: Re: MACH4 Profiles
Post by: cncman172 on November 17, 2016, 04:15:30 PM
Daz,
Which video?  You did not provide the link...

Allan,
OK, I will do the HELP>Support>Package Current Profile thing and see if I can understand better what I am doing wrong.

I never used profiles in the past and updated the Mach4Mill and it worked perfect.  Then I decided to update MACH4 and lost everything I had changed and learned my lesson.  Now before I spend anymore time I want to understand how everything gets saved.  Right now the only module I had loaded but not used with the module that someone wrote for each access to the most common functions inside of MACH4, can remember who but he is a big contributor and developer.  Anyway I have not added any calls to that module at this point.

Russ
Title: Re: MACH4 Profiles
Post by: DazTheGas on November 17, 2016, 04:20:22 PM
OOPs try this

https://www.youtube.com/watch?v=u5NbpqAuTxQ&index=15&list=PL7IitnI6IOQAUp6rOgtcQLwz7U8E4XHvq (https://www.youtube.com/watch?v=u5NbpqAuTxQ&index=15&list=PL7IitnI6IOQAUp6rOgtcQLwz7U8E4XHvq)


Both profile name and screen name need to be unique names not used more than once then they can never be overwritten unless its a backup of the origianal profile.


DazTheGas
Title: Re: MACH4 Profiles
Post by: cncman172 on November 17, 2016, 04:37:36 PM
Daz,

Thank you very much.  I now see I never did rename the WX4 screenset so that is a step I missed.  The rest of the stuff I did as your very good video showed.  Your videos are the best by the way, I have learned so much from all your videos.  Now I will start all over and reconfigure a brand new profile and screenset and then put all my code back.  Hopefully, I can get it to all run again.  LOL

Russ