Hello Guest it is March 28, 2024, 05:59:16 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 - wrecks

Pages: 1
1
Mach4 General Discussion / Saving Mach 4 Register Values
« on: December 19, 2020, 10:36:44 AM »
I've modified my Mach 4 lua scripts a bit and have managed to create a few ways to crash the program. This is no big thing, as I pretty much know what not to do to cause a crash. Anyway, through these unexpected shutdowns, I've discovered that the register values, tool height settings, and workspace coordinates, etc, are not saved except during an orderly shutdown. This means that if the Mach 4 crashes, all the changes I've made during that session are lost.

Is there a way to force the application to save all settings, registers, tool heights, etc? Something I could execute via a customized button?

2
Mach4 Plugins / Re: How can I reset Mach4 Modbus through lua?
« on: August 28, 2020, 06:26:02 PM »
Ha! Thanks for that info. I didn't know about mbcntl/command.

I couldn't get "RESTART" to work, but sending "STOP" and then "START" once the status changes to stopped does what I want.

You made my day. Thanks again.

3
Mach4 Plugins / How can I reset Mach4 Modbus through lua?
« on: August 27, 2020, 08:12:15 PM »
I am developing tool changer using an arduino, and have set up communications to Mach4 using the Modbus plugin. This part was way easier to set up than I expected.

I am adding a tool changer tab to the mach4 operator screen. This will show the status of the tool changer arduino, give the capability to do manual control operations, show arduino I/O statuses, etc.

I want to add button to this screen to re-initialize the modbus connection in case it has an error, such as happens if the Ethernet cable is unplugged or the arduino power is cycled. I have discovered that opening and closing the modbus configuration screen will reset the modbus and clear the error. I want to make a button that will perform the same function.

Any advice?

4
Mach4 General Discussion / Changing default state of toggle buttons
« on: March 16, 2020, 11:12:07 AM »
I have found this snippet of code in screenscript.lua

    -------------------------------------------------------
    --  PLC First Run
    -------------------------------------------------------
    if (testcount == 1) then --Set Keyboard input startup state
        local iReg = mc.mcIoGetHandle (inst, "Keyboard/Enable")
        mc.mcIoSetState(iReg, 1) --Set register to 1 to ensure KeyboardInputsToggle function will do a disable.
        KeyboardInputsToggle()
       
        --scr.SetProperty('btnCycleStart', 'Label', 'Cycle Start\nGcode')
        prb.LoadSettings()

The snippet is in function Mach_PLC_Script()
   
 I want to change this to make Keyboard/Enable enabled on startup instead of disabled.

I know how to write the code, but I can't figure out how to open an editor that contains the code. How do I edit Mach_PLC_Script? i have tried very hard to figure this out myself, but I give up.

I am using Mach 4

Pages: 1