Hello Guest it is April 12, 2024, 07:54:56 AM

Author Topic: Issues communicating PoKeys57CNC and Mach4 running on Windows 11 Home PC  (Read 858 times)

0 Members and 1 Guest are viewing this topic.

Some background Information

I am using a Windows 11 Home PC to control a plasma cutting machine. The windows 11 machine uses Mach4 as the interface for controlling the plasma cutter and a PoKeys57CNC as the control board for the CNC.

The PC stuff

I am trying to create a sort of single app mode for the PC so that when I sign in to a specific user account, only Mach4 will run, and no other app. I have succesfully managed to create this Kiosk Mode by modifying registry entries, such as:

  • HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon [Shell]
    Sets which application gets loaded on sign in, this is set to `explorer.exe` by default.
  • HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer [NoViewContextMenu]
    Disabled right clicking when file explorer is open.
  • HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer [NoTrayContextMenu]
    Disabled right clicking on the windows start menu (I think).
  • HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer [NoViewOnDrive]
    Disabled access to certain drive letters on Windows, in my case I set it to disable access to all Drives, exclusing the Z drive. In another script I then create a virtual drive (using `subst`) that is connected to a specific folder and make it the Z drive.
    This causes issues so I haven't really been using it, but I thought I would include it just because.
  • HKCU\Console\\%%Startup [DelegationConsole]
    Changes the default terminal to use Windows Console Host instead of Windows Terminal.
  • HKCU\Console\\%%Startup [DelegationTerminal]
    Changes the default terminal to use Windows Console Host instead of Windows Terminal.
  • HKCU\Software\Classes\CLSID\{52205fd8-5dfb-447d-801a-d0b52f2e83e1}\shell\opennewwindow\command [Default]
    Sets the default open location for windows explorer. I set this to be the Z drive.
  • HKCU\Software\Classes\CLSID\{52205fd8-5dfb-447d-801a-d0b52f2e83e1}\shell\opennewwindow\command [DelegateExecute]
    Does something that I can't remember right now.
  • HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System [DisableTaskMgr]
    As it says, this disables task manager access when signed (so that nobody just disables the Kiosk Mode).
  • HKCU\Software\Policies\Microsoft\Edge\URLBlocklist [1]
    Disabled all URLs on Microsoft Edge.

This has resulted in a working Kiosk mode, but produces issues with the Mach4 connection to PoKeys. In the Shell entry I have a custom powershell script that loads on every sign in and which dictates what gets runs while the user is signed in.
In this case, my script basically creates the virtual Z drive (using `subst`), and starts the Mach4 application. Lastly, when Mach4 closes it signs out of the user account.

I have tried to figure out what the issue could be and have found a few interesting things that might be able to allow someone more knowledgeable than me to figure it out as I haven't managed it yet.

  • It works on the main user account (which is an administrator account) with no issues.
  • It works on the kiosk account when the registry entries are not all set (I think the only registry entry that affects this is the first one which changes the Windows shell to something else.
  • When in the kiosk user account with all the registry entries loaded, if I  sign in (which loads Mach4) and then out 3 times, and then sign in one more time. The connection gets made and it works perfectly.
  • I have included in the sign-in shell script, some code that essentially closes and opens Mach4 4 times and then opens it a final time for actually use. This did not work for solving the problem which implies that it is the process of signing out and then in again that fixes the problem.