Hello Guest it is April 23, 2024, 09:21:20 PM

Author Topic: Can't save edited screen load script  (Read 1548 times)

0 Members and 1 Guest are viewing this topic.

Can't save edited screen load script
« on: August 22, 2021, 04:38:48 PM »
Trying to add a cycle start button. Found an old thread telling how to edit the file to make the button work. I do the edits and get an error trying to save. Access error, cannot save file. I have not registered the Mach4 yet as the docs say to get everything working first. Could that be stopping me from a save. I do start the program in administrator mode. Any ideas as to why I would not be allowed to save a script?

Re: Can't save edited screen load script
« Reply #1 on: August 22, 2021, 04:49:29 PM »
Trying to add a cycle start button. Found an old thread telling how to edit the file to make the button work. I do the edits and get an error trying to save. Access error, cannot save file. I have not registered the Mach4 yet as the docs say to get everything working first. Could that be stopping me from a save. I do start the program in administrator mode. Any ideas as to why I would not be allowed to save a script?

No idea what are you doing and not save, not have something with not registered. Only thing i did was:
Add button
Add at left up script
Code: [Select]
CycleStart()Save script and close
Save screen and exit edit
Load gcode and mouse click on new button
Re: Can't save edited screen load script
« Reply #2 on: August 22, 2021, 05:07:48 PM »
I added a physical button in the control panel door. Then I mapped it thru the ESS and in mach4. If I go to the diagnostic screen and press the button the light for input0 lights. I read on the forum that the screen load file needs to be edited to associate the input0 button press with a cycle start to make the button work. I found the example in the file rem'd out. I made the changes to the script and when I tried to save the script I was denied.
Re: Can't save edited screen load script
« Reply #3 on: August 22, 2021, 05:15:12 PM »
I added a physical button in the control panel door. Then I mapped it thru the ESS and in mach4. If I go to the diagnostic screen and press the button the light for input0 lights. I read on the forum that the screen load file needs to be edited to associate the input0 button press with a cycle start to make the button work. I found the example in the file rem'd out. I made the changes to the script and when I tried to save the script I was denied.

This is something different..
At screen load script add or edit an already that is not used like this:
Code: [Select]
[mc.ISIG_INPUT0] = function (state)
    if (state == 1) then   
CycleStart()
   end
end,

If you show the code you try to change it would be better to find the error, lua language is not forgiving about grammar errors.

Offline thosj

*
  •  532 532
    • View Profile
Re: Can't save edited screen load script
« Reply #4 on: August 22, 2021, 05:37:22 PM »
You ARE editing the screen load script in the screen editor, correct? Not trying to edit some LUA file outside Mach4?

If so, just add a comment line somewhere, like:

--Comment to test

Save. Can you save?
--
Tom
Re: Can't save edited screen load script
« Reply #5 on: August 22, 2021, 05:39:44 PM »
[mc.ISIG_INPUT0] = funtion (state)
    if (state == 1) then
        cyclestart()
    else
        mc.mcCntlFeedHold (0)
    end
end


This is what I believe the UnRemmed version would be based on my needs. I could be wrong I am used to VB script.



Yes I am editing inside of mach4 with the editor by clicking the "operator" tab and then "open script editor".

No I cannot save. tried at least half a dozen times
« Last Edit: August 22, 2021, 05:45:51 PM by stevehuck »
Re: Can't save edited screen load script
« Reply #6 on: August 22, 2021, 05:45:05 PM »
[mc.ISIG_INPUT0] = funtion (state)
    if (state == 1) then
        cyclestart()
    else
        mc.mcCntlFeedHold (0)
    end
end

This is what I believe the UnRemmed version would be based on my needs. I could be wrong I am used to VB script.

At the second "end" must have a "," if is not the last.
Code: [Select]
    end
end,
The "cyclestart()" need to be with capital c "Cyclestart() "
Re: Can't save edited screen load script
« Reply #7 on: August 22, 2021, 05:57:26 PM »
Here is the code I tried and the error I get trying to save

Re: Can't save edited screen load script
« Reply #8 on: August 22, 2021, 06:02:38 PM »

Yes I am editing inside of mach4 with the editor by clicking the "operator" tab and then "open script editor".

No I cannot save. tried at least half a dozen times

Now i see it, no don't use "open script editor". Just go in "operator" and "edit screen" option.
Then you select the first selection at left and go to load script.
Re: Can't save edited screen load script
« Reply #9 on: August 22, 2021, 06:04:11 PM »
Check the picture