Hello Guest it is April 26, 2024, 03:19:25 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rhtuttle

141
Mach4 General Discussion / Hotkeys/Shortcuts
« on: December 09, 2020, 11:45:06 AM »
As far as I can tell Mach4 keyboard plugin only allows for keys to map to jogging functions.

Is there a way to configure a key (ESC) to map to a button (btnStop) or call a macro?

TIA

RT

142
Mach4 General Discussion / Re: Need Help - Mach4 errors w/ PMDX-424
« on: December 05, 2020, 07:27:18 PM »
I and another user tried the usb and it would not run consistently for either of us.  Top of the line computers and tried both usb 3 and usb 2 cables per their suggestion.  If you search other posts you will find several others that tried and failed with usb

143
Mach4 General Discussion / Re: Need Help - Mach4 errors w/ PMDX-424
« on: December 04, 2020, 10:37:17 AM »
Pokeys 57CNC does not work with Mach4 on USB.  Works great over ethernet.


144
Mach4 General Discussion / Re: Adding field for value input
« on: November 27, 2020, 02:39:49 PM »
rc = mc.mcProfileFlush(number mInst)
rc = mc.mcProfileSave(number mInst)

I see you are saving the value as a string and then reading it back as an int but setting the value of the DRO as a string.
Have you checked the droVal returned by the getProperty?  Is it a string or a number?

I think the preferred method is to not write to the profile but to create gReg entry (Config->Plugins->RegFile, Global Registers Tab) and mark it as persistent. It will be read and saved automatically and you can access its value as needed.  Set the 'Register' property of the DRO to be that variable.

HTH

RT

145
Mach4 General Discussion / Re: Adding field for value input
« on: November 19, 2020, 10:58:27 AM »
Yes.  See bryanna's video on screen set editing.  Add a dro where you want and name it. in the events for that dro either update a register that you create or write the value to a profile string.  In the startup script or in the macro read either the register or the profile value.

HTH

RT

146
Mach4 General Discussion / Re: scr.GetProperty
« on: October 30, 2020, 12:04:05 PM »
First is to make sure that you have the component name spelled exactly as it appears in the screen tree.  If you run the following script line by line in the debug mode (F5 followed by F11, F11) cursor over sc should be a 'table:' and rc should be the value you were looking for.  I have this tested this since it is using an existing slide component.
 
local sc=scr
local rc=scr.GetProperty('slideSRO','Value')
local tst=1

HTH

RT

147
He needs to write that code in a module and then call it from the macro after instantionating it with a 'require' .
example:

MyRtModule.lua

MyRtModule={}
  MyRtModule.myFunc() return (1) end
  MyRtModule.myFunc2() return(2) end
return MyRtModule

macro:
function m6060
  local rt=require "MyRtModule"
       local rslt=rt.myFunc()
end
Mach4 has a chunk that the GUI runs under and another chunk that runs macros.

148
Mach4 General Discussion / Re: lua error while running chunk
« on: October 07, 2020, 12:21:23 PM »
The ButtonEnable function is defined upon loading and is not related to a specific button but rather checks the 'AxisTable' table for pairs.  I would think that because the function is nil that there is a problem with your install of Mach4 Lua files.  You could copy your current Profile to another directory and reinstall, then copy the profile back and see if you get the same error code.

Did you make any changes to the screen you are working with? 
I assume you have created and are using a new profile based on the mill profile and done the same with the screen set you are using.  If not then installing over the existing ones will negate all changes you have made.

HTH

RT



---------------------------------------------------------------
-- Button Enable function Updated 11-8-2015
---------------------------------------------------------------
function ButtonEnable() --This function enables or disables buttons associated with an axis if the axis is enabled or disabled.

    AxisTable = {
       
  • = 'X',
  • [1] = 'Y',
            [2] = 'Z',
            [3] = 'A',
            [4] = 'B',
            [5] = 'C'}
           
        for Num, Axis in pairs (AxisTable) do -- for each paired Num (key) and Axis (value) in the Axis table
            local rc = mc.mcAxisIsEnabled(inst,(Num)) -- find out if the axis is enabled, returns a 1 or 0
            scr.SetProperty((string.format ('btnPos' .. Axis)), 'Enabled', tostring(rc)); --Turn the jog positive button on or off
            scr.SetProperty((string.format ('btnNeg' .. Axis)), 'Enabled', tostring(rc)); --Turn the jog negative button on or off
            scr.SetProperty((string.format ('btnZero' .. Axis)), 'Enabled', tostring(rc)); --Turn the zero axis button on or off
            scr.SetProperty((string.format ('btnRef' .. Axis)), 'Enabled', tostring(rc)); --Turn the reference button on or off
        end
       
    end

149
Mach4 General Discussion / Re: lua error while running chunk
« on: October 05, 2020, 11:20:06 AM »
Does this error occur on startup or when you press the enable button?

150
Mach4 General Discussion / Re: Toggle Button not clickable
« on: July 16, 2020, 11:29:52 AM »
Could not replicate the error.  I named it and set all properties the same as yours.  Worked as expected even after shutting down and restarting.  The only thing I couldn't replicate is the color Silver but I wouldn't think that has anything to do with it.  Have you tried deleting it and adding another toggle button?

HTH
RT