Hello Guest it is April 25, 2024, 07:21:02 PM

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 - SwiftyJ

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »
101
Mach4 General Discussion / Re: Modbus control huanyang GT vfd
« on: November 05, 2021, 04:14:17 AM »
That will be because the PMC is continuously writing to that register every couple of milliseconds. So whatever value you enter is being instantly overwritten.

I modified the script on my system to update another register I created, and when I enter S1000 into the MDI the register updates. So I am not sure why this isn't working on your system..

102
Mach4 General Discussion / Re: Modbus control huanyang GT vfd
« on: November 04, 2021, 10:39:34 AM »
Try replacing this line

local spindle_rpm = scr.DroRead(mInst, 27)

with this:

local spindle_rpm = mc.mcSpindleGetCommandRPM(mInst)

I'd edit the lua file with mach closed

103
Mach4 General Discussion / Re: Modbus control huanyang GT vfd
« on: November 03, 2021, 10:35:46 AM »
A couple of things to check:
Did you add the .lua file to the PMC and enable it through the screen editor?
Are your register names for the modbus exactly the same as it shows in the instruction? The PMC is writing to these specific register paths so it needs to match.


104
Mach4 General Discussion / Re: How to use USB camera with Mach4
« on: October 18, 2021, 01:45:13 PM »
Multiple things are wrong with your macro
 1. You don't declare 'inst' so this will likely be nil and cause the API to fail - you should check the return code to test for this
 2. You are missing 'end' from the function
 3. I would declare YShift as a local variable

If you hit F7 on your keyboard in ZeroBraneEditor it will compile the code and tell you if there are any mistakes... but won't tell you all the mistakes  ;)

Try the following
Code: [Select]
function m111 ()
local inst = mc.mcGetInstance()
local YShift = 10
mc.mcCntlSetPoundVar(inst, mc.SV_HEAD_SHIFT_Y, YShift)
end

if (mc.mcInEditor () == 1) then
m111 ()
end

105
If you go into the screen editor, select the toolpath, and then on the left side in the properties area there is a option to display the soft limits. You will need to do this for all toolpaths in your screen.

106
Mach4 General Discussion / Re: Gage Block DRO
« on: October 08, 2021, 02:34:46 PM »
Hi Craig,

The code is something like this..

Code: [Select]
local droVal = select(1,...)  --This gets the value that was entered into the DRO.

droVal = droVal + 1 --Do some stuff

return droVal --Returns the value to the DRO and updates any linked registers etc.

I thought the DRO's were broken too at first, but this way of getting the value from the DRO is so much easier than what I was doing previously

107
Mach4 General Discussion / Re: Mach 4 auto "bed" compensation
« on: October 01, 2021, 03:13:27 AM »
There is a video on the surface wizard on the Mach Support youtube channel

https://www.youtube.com/watch?v=M4o6dfQrAo8

108
Mach4 General Discussion / Re: activate script on button from script
« on: September 28, 2021, 11:15:45 AM »
You are missing the 'inst' from mcCntlGetState.. see below

Code: [Select]
function WaitForIdle()
    local inst = mc.mcGetInstance()
    local state = mc.mcCntlGetState(inst)
    if (state == mc.MC_STATE_IDLE) then
         return true
    end
    return false
end

109
Mach4 General Discussion / Re: Lua Error
« on: September 18, 2021, 05:24:13 AM »
Try deleting all .mcc files in the macros folder for the profile you are using and restart Mach. It should then recompile everything and give you mcLua.mcc

110
Mach4 General Discussion / Re: Tool changing to wrong number
« on: September 10, 2021, 04:45:10 PM »
You need to replace the parameters.ini file in your profile folder. For some reason this can get corrupted and causing this setting to always revert to next tool to use

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »