Hello Guest it is April 25, 2024, 09:58:48 AM

Author Topic: Problems - Win10 update + PMDX_424 + LUA  (Read 2614 times)

0 Members and 1 Guest are viewing this topic.

Problems - Win10 update + PMDX_424 + LUA
« on: February 07, 2020, 09:55:08 AM »
Over Xmas break I decided to update windows on all my computers.  After updating windows, I got a new error when trying to home my machine:

Code: [Select]
PMDX-SmartBOB-USB X-axis homing error, missing or invalid home switch configuration PMDX-SmartBOB-USB Y-axis homing error, missing or invalid home switch configuration
I contacted Steve at PMDX and was advised to update PMDX plugin/firmware along with Mach4.  Now I get this message when starting Mach4:

Null_Value_Error.jpg


This appears to be in regards to my PLC script used to display a DRO from PMDX424 Encoder input:

Code: [Select]
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, "SmartBOBUSB/EncoderDRO")
local zEncoderVal = mc.mcRegGetValueString(hreg)
local zEncoderVal = tonumber(zEncoderVal)
local zEncoderValInches = (zEncoderVal * 0.0004)
WriteRegister("Z_DRO_INCH", tostring(zEncoderValInches))

The SmartBOBUSB/EncoderDRO register value is now null.  If I look at the real time diagnostics for the PMDX424, it shows the encoder input as "Disabled":

RT.jpg



If I look at the Register diagnostics, the value for SmartBOBUSB/EncoderDRO is blank and it will not accept a manually entered value:

Register_Diagnostics.jpg


I can tell it's reading the encoder because the log shows signal 11 and 12 alternating to Hi/Low as it should for channel A/B of the encoder.

I have made no changes to configurations, profile or scripts for 3 years.  All I wanted to do was update windows and now I have had a machine down for over a month  :-\  Any ideas what changed to cause these issues?

Mach4 Build#: 4300
PMDX Plugin Version: 0.53.263
PMDX Bootloader Version: 1.9.66
PMDX Firmware Version: 0.60.208
Windows 10 Pro Version: 1909, OS build 18363.535
« Last Edit: February 07, 2020, 10:05:58 AM by beezerlm »

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #1 on: February 08, 2020, 07:27:07 PM »
Are you using an old screen set?
« Last Edit: February 08, 2020, 08:12:13 PM by Graham Waterworth »
Without engineers the world stops
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #2 on: February 08, 2020, 08:05:45 PM »
It's a screenset I made in 2016/2017.  Is that considered old?

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #3 on: February 08, 2020, 08:11:16 PM »
I would try one that was installed with that version of Mach4, a lot has changed in the Lua versions in the last 2 years.
Without engineers the world stops
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #4 on: February 08, 2020, 08:31:46 PM »
Will do next time I'm at the shop.

So what would be the process of updating my old custom screenset?

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #5 on: February 08, 2020, 08:50:33 PM »
The problem is that some plugin code in the back of the screens was updated to reflect the new Lua version which can in some cases break custom screen sets.

It all depends how custom your screen set is.

You can replace your old screen set Lua code with the new Lua code from the latest std screen set and hope for the best.

If that fails its time to redo your screen set using the latest std screen set as a template.


Without engineers the world stops
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #6 on: February 10, 2020, 09:55:44 AM »
Well I loaded the stock wx4.set screen and the lua error went away.  Can you tell me in more detail the best way to replace my old screen set Lua code with the new Lua code from the latest std screen?  I would really like to avoid rebuilding my custom screen if possible.

I am still getting PMDX errors when attempting to home the machine:

Code: [Select]
PMDX: X-axis homing error, missing or invalid home switch configuration
PMDX: Y-axis homing error, missing or invalid home switch configuration

Also when moving the Z axis (Z is pneumatic/manual but uses SmartBOBUSB/EncoderDRO for encoder feedback) I get this on every encoder count:

Code: [Select]
PMDX: Encoder mode has index, cannot set Encoder Position
I have not changed any pin configurations at all, so I am unsure why these errors have emerged?
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #7 on: February 10, 2020, 01:14:28 PM »
Hi,
the stock wx4.set screen set attempts to home ALL four axes, X, Y, Z and A. If you don't have an A axis the error results.
Go to the homing routine is the screen load script and remove (or equivalently, comment it out) the A axis home command.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #8 on: February 12, 2020, 09:57:51 AM »
I have X,Y,Z and A ( I call this "U" ) axis.

I loaded the stock wx4 screen and got the same PMDX XY Homing Error.  I disabled Z & U axis and then the machined would home X and Y without error.  I then re-enabled Z & U axis and the machine homes fine now.  Almost seems like it was a stuck register value, although I still haven't been able to load my custom screen so I might not be out of the woods on that yet.

I am still getting the "PMDX: Encoder mode has index, cannot set Encoder Position" error whenever I move the Z axis.  I have the encoder set to just read A&B channels with no index. When I first start Mach 4, If I look at the real time IO for the PMDX424, It always says "Disabled" for the encoder position register.  If I change encoder settings, then change them back, the real time IO register view shows a count as it should.  If I exit the configuration settings and go to Mach4's Diagnostic dropdown and then select the real time IO view, it appears to count the encoder as though it's reading RPM instead of just counting?  If I go to the register diagnostics for SmartBOBUSB/EncoderDRO the value is always blank and I can never manually enter a value here.  The encoder mode error when Z is moved is persistent throughout all of this also.   

Also,  I think my custom screen Lua error message is due to a null value at the SmartBOBUSB/EncoderDRO register.

 
« Last Edit: February 12, 2020, 10:02:14 AM by beezerlm »
Re: Problems - Win10 update + PMDX_424 + LUA
« Reply #9 on: February 13, 2020, 08:59:53 AM »
Today I uninstalled the PMDX plugin and mach4 and tried a complete fresh install of Mach 4300 and the latest PMDX_424 plugin.  When I tried to open the PMDX_424 sample profile this error occurred:

Code: [Select]
Lua: Error occurred while opening file
cannot open C:\Mach4Hobby\Profiles\PMDX-424-Sample\Macros\mcLua.mcc: No such file or directory


I then opened the stock mach4 mill profile and did not get the LUA error.  I configured the PMDX424 as the motion device and set the encoder as channel A&B no index.  I get the same PMDX Encoder error when manually moving Z axis:

Code: [Select]
PMDX: Encoder mode has index, cannot set Encoder Position
I can't for the life of me figure out what is causing this error? This is a fresh install with stock settings/profiles.
« Last Edit: February 13, 2020, 09:02:31 AM by beezerlm »