Hello Guest it is January 28, 2020, 07:33:50 AM

Author Topic: External Control Panel Jog Buttons  (Read 179 times)

0 Members and 1 Guest are viewing this topic.

External Control Panel Jog Buttons
« on: November 05, 2019, 04:34:59 AM »
Hi All

I am not a Lua programer - I'm a good copier of what people have done before. And so on my external control panel I have most of the buttons working great such as "cycle start, "feed hold" and "stop as I have been able to copy them from other peoples previous work.

So my last stage is to get my jog buttons to work - I have X plus, X minus, Y plus buttons and so on. I would like them to work as they do on the "jog tab"on the screen - pick up the increment setting, continuous or incremental jog type - basically mirror what happens when you press the button on the screen.

Is there a way to access the script that these screen buttons do when pressed? If not could someone who understands Lua write me one example of how to do this please so I can put it into my screen load script?

My thought so far are -
- read if the button is pressed (mc.ISIG_Input4 - or to suit the input set up for the button) function = (state)
  if (state == 1) then
 Button Down (help here please)
- read the increment setting (help here please)
- read incremental or continuous jog setting (help here please)
- start the jog for the correct axis and settings above - stop after 1 increment if set for incremental jog (help here please)
Button Up (help here please)
- stop the jog if set for continuous jog (help here please)
end
end,

Any help would be appreciated - I am lost without you guys.

Thank you for your time.

Regards
Steve

Offline Bill_O

*
  •  250 250
    • View Profile
Re: External Control Panel Jog Buttons
« Reply #1 on: November 05, 2019, 08:22:37 AM »
Steve,

This is not a direct help but it still might help you.
It is not complete but I have not had the time to add to it.

Bill

https://www.machsupport.com/forum/index.php?topic=39763.msg266718#msg266718
Re: External Control Panel Jog Buttons
« Reply #2 on: November 05, 2019, 02:56:20 PM »
Hi Bill

Thanks for that - it will give me some clues what to do.

So can I take it you cannot access the scripts built into the screen buttons already, is this a bad idea and I should go down programming my screen script path directly?

Steve

Offline Bill_O

*
  •  250 250
    • View Profile
Re: External Control Panel Jog Buttons
« Reply #3 on: November 05, 2019, 03:21:32 PM »
Steve,

You can access the scripts in the buttons.
Just be very careful what you change.
I usually make a new button and copy the script from the standard button.
Then if I mess something up I still have the original to start with again.

Bill
Re: External Control Panel Jog Buttons
« Reply #4 on: November 05, 2019, 05:03:05 PM »
Thanks Bill

Would you be able to tell me the way to call the button scripts please?

Thanks
Steve

Offline Bill_O

*
  •  250 250
    • View Profile
Re: External Control Panel Jog Buttons
« Reply #5 on: November 05, 2019, 05:52:53 PM »
Steve,

It is done in the screen editor.
Go to Operator then Edit Screen
Be very careful. Anything you move, change or add can be in your screen.

Click on a button you want to see the code for.
Under the Properties Section on the left bottom side of the screen click the second icon. (has a lightning bolt on it)
There are several different places that script could be. Click on the script and it will pull up another window.

If you are using the Mill click on the Probing tab then the Measure X button.
There is script under Clicked Script.

I probably did not explain this well but I hope you understand.

Bill

Re: External Control Panel Jog Buttons
« Reply #6 on: November 05, 2019, 06:12:52 PM »
Thanks Bill
I will give it a go.
Steve