Hello Guest it is June 11, 2024, 09:43:32 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.


Topics - TommyG

Pages: 1
1
Mach4 General Discussion / Signal Library - RPM change signal?
« on: January 30, 2022, 11:57:21 AM »
Continuing my mission to use the Signal Library to control a VFD via MODBUS...

Is there a signal in the Signal Library that's raised when the spindle RPM is changed?

On that topic, is there a document anywhere with all the signals listed?

Thanks

Tommy

2
Mach4 General Discussion / Writing to a register from Signal Script
« on: January 30, 2022, 10:55:49 AM »
Hi folks

I'm new to Mach4 programming although I've a reasonable bit of experience with both Mach4 and programming individually :-)

I'm trying to configure Mach4 to control a VFD via MODBUS. I've the MODBUS bit up and working and can control the spindle via the "Diagnostic - Newfangled Solutions - MODBUS" screen but I'm having trouble wiring the relevant control signals to the MODBUS registers.

I can do this with a PMC script but a more elegant method would seem to be to use a signal script. However, went I try to set the register value I get an error "attempt to call a nil value (field 'RegSetValue')" I've added some debugging messages and I can see that the 'hreg' variable is getting a value.

The code below has been added to my screen load script in the 'SigLib' section. I'm just using test registers for debugging.
Code: [Select]
[mc.OSIG_SPINDLEFWD] = function (state)
    if (state == 1) then
local hreg = mc.mcRegGetHandle(inst, "iRegs0/test/spindleCtrl")
mc.RegSetValue(hreg, 1)
    else
mc.mcCntlSetLastError(inst, "INFO: OSIG_SPINDLEFWD != 1")
local hreg = mc.mcRegGetHandle(inst, "iRegs0/test/spindleCtrl")
mc.mcCntlSetLastError(inst, "INFO: hreg value was " .. tostring(hreg))
mc.RegSetValue(hreg, 0)
    end

end,

I get the error when I click on 'Enable' in Mach4, I'd assume part of the enable process is to set the motor off so that makes sense.

Any help would be greatly appreciated.

Tommy

3
Hi

I'm trying to get started writing some macros of my own. As a starting point I'm writing some simple g-code and running that like any normal job but the variables don't seem to be working. I've a really simple example below, define x, y and z coordinates as variables and then move to that location but when I run the job the machine simply moves to 0,0,0?

I'm running Mach 4. Suggestions on a postcard?

N000 G00G21G17G90G40G49G80
N010 G91.1
N020 G94
N030 #1001=75.0
N040 #1002=57.5
N050 #1003=-20
N060 G0 X#1001 Y#1002 Z#1003

4
Hi

I'm fairly new to screen editing and I'm sure this has been answered elsewhere but I couldn't see it.

I want to change the homing function (initial home at full speed but back off very slowly) but when I edit the screen the ref (Y) button for example is just simple "Home Y".

Is this "Home Y" a built-in function of the program or a macro? If the latter, how do I edit them?

thanks

tommy

5
Mach4 General Discussion / Disable keyboard control on startup?
« on: August 09, 2016, 09:44:30 AM »
Hi

Can anyone advise if there's a script option to disable the keyboard plug-in on start-up? It's rather confusing to word, I'm not looking to actually disable the plug-in itself, just to have the equivalent option of clicking on the keyboard icon in the taskbar so that keyboard jogging, etc. are disabled?

For example, I have "mc.mcSoftLimitSetState(inst, 0, 1)", etc.  in my screen load script to automatically enable soft limits, is there an equivalent for the keyboard icon.

On a related note, is there a comprehensive list of the Mach4 scripting commands available?

thanks

Pages: 1