21
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: January 06, 2019, 04:07:51 PM »
Hi,
I have similar problems trying to display the X and Z DRO readings on a 4x20 LCD display. I'm running a Pokeys57 card with Mach4. At start-up the LCD does display "Pokeys plugin for Mach4" and I have done all the basic checks to ensure the LCD is working.
In the screen script for the X DRO I have placed:
local inst = mc.mcGetInstance()
local Xcoords = scr.GetProperty("droCurrentX", "value")
local hreg = mc.mcRegGetHandle (inst, string.format("Pokeys_Lathe / LCD Line 1"))
Xcoords = string.format("X: %4.4f", Xcoords)
mc.mcRegSetValue(hreg, tostring (Xcoords).. " ")
However, when I enable and run Mach4, and jogging the X axis the axis move but the X DRO stays fixed at 0.00 and I get the error message:
C:\Mach4Hobby\ScreenScript.lua 764
Bad argument #2 to 'format' (number expected, got string)
stack traceback:
[C]:\Mach4Hobby\ScreenScript.lua:764 in function C:\Mach4Hobby\ScreenScript.lua760
I have to remove the code, not only comment it out, to get the X DRO going again.
Any help will be greatly appreciated.
Danie
I have similar problems trying to display the X and Z DRO readings on a 4x20 LCD display. I'm running a Pokeys57 card with Mach4. At start-up the LCD does display "Pokeys plugin for Mach4" and I have done all the basic checks to ensure the LCD is working.
In the screen script for the X DRO I have placed:
local inst = mc.mcGetInstance()
local Xcoords = scr.GetProperty("droCurrentX", "value")
local hreg = mc.mcRegGetHandle (inst, string.format("Pokeys_Lathe / LCD Line 1"))
Xcoords = string.format("X: %4.4f", Xcoords)
mc.mcRegSetValue(hreg, tostring (Xcoords).. " ")
However, when I enable and run Mach4, and jogging the X axis the axis move but the X DRO stays fixed at 0.00 and I get the error message:
C:\Mach4Hobby\ScreenScript.lua 764
Bad argument #2 to 'format' (number expected, got string)
stack traceback:
[C]:\Mach4Hobby\ScreenScript.lua:764 in function C:\Mach4Hobby\ScreenScript.lua760
I have to remove the code, not only comment it out, to get the X DRO going again.
Any help will be greatly appreciated.
Danie