Hello Guest it is March 29, 2024, 03:33:52 AM

Author Topic: Mach4 license verification check from LUA  (Read 268 times)

0 Members and 1 Guest are viewing this topic.

Offline mzc

*
  •  11 11
    • View Profile
Mach4 license verification check from LUA
« on: March 19, 2023, 03:47:11 AM »
Hi, I'm trying to figure out what the parameters are for the mcCntlCheckLicenseFeature LUA function.

e.g. "requirement" and "feature".

What I'm trying to achieve is a check at startup (in my custom LUA code) to warn me (big nasty popup window)  if I'm running under a demo license (or not if its a full (Hobby in my case) license).

The API reference does not give me too many clues on this, but of the 3 API functions that have "License" in their name, that one seems the most likely candidate.

Why?

After a Windows (10) update that I think ran on my PC a few weeks ago, when I was using my CNC yesterday (running the 1st job on it for the weekend), it stopped half way through. I figured out that Mach was in Demo mode. So I got the PCID, downloaded the license file from the web site and pressed on.

When I was shutting down the PC at the end of the day, Windows wanted to do an update (apply one), so I selected install/apply and shut down and went inside from the shed and didn't think about it again.

The next day (today), I got half way through my 1st CNC job and it paused again! AHHH! It was in Demo mode. It looks like the PCID had changed again after the update. So easily fixed with a new download from the mach website, but certainly irritating. I'd like to avoid that with a simple LUA script that warns at startup if Mach4 is in Demo mode. The title bar is just too easy to miss!

Cheers,

Michael.

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: Mach4 license verification check from LUA
« Reply #1 on: March 19, 2023, 06:32:46 AM »
Just my 2 cents…

In many ways it is wise to treat the PC which runs a machine as a machine controller which just runs GCode. – it never gets to see the internet or download / run updates etc.
Keep your best PC for all the CAD/CAM and internet stuff and use a very basic PC for running Mach4.

Tweakie.
PEACE
Re: Mach4 license verification check from LUA
« Reply #2 on: March 19, 2023, 04:16:48 PM »
Hi,

Quote
The next day (today), I got half way through my 1st CNC job and it paused again! AHHH! It was in Demo mode. It looks like the PCID had changed again after the update. So easily fixed with a new download from the mach website, but certainly irritating. I'd like to avoid that with a simple LUA script that warns at startup if Mach4 is in Demo mode. The title bar is just too easy to miss!

You should not allow Windows to update....ever. If Widows is working today.....why do you need to update? Only if you are on the internet which is plain foolish.

As it was explained to me years ago 'once you hook a PC to a CNC machine it is no longer a PC (ie general purpose computing platform) but a machine controller that just
happens to use Widows as an OS'. A machine controller should not be on the internet, or even on a network. There should be no software on the PC that is not directly related to
running the machine. Note this includes your CAD/CAM software....they should be on another PC elsewhere.

My machine is controlled by a Dual Core Atom single board PC with on-chip graphics, a very VERY low power PC, and yet it runs my machine just fine. I installed Windows 7 Embedded nine years
ago, and its never been touched since. It does not have a Firewall or Virus Protection, I don't just mean that they are turned off, they are not present on the PC at all. The whole point about
using an Embedded version of an OS is so that you include only those things that you need and do not install anything you do not need. Given that this is a machine controller I do not need
to connect to the internet and therefore a Firewall and Virus Protection are not required.

You need to come up with a separate PC for your machine alone.....and it does not need to be powerful, one of the kids cast off school laptops would be fine.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'