Hello Guest it is April 28, 2024, 03:59:27 PM

Author Topic: Mach4 Hobby mcJogSetInc GUI vs external Button  (Read 571 times)

0 Members and 1 Guest are viewing this topic.

Mach4 Hobby mcJogSetInc GUI vs external Button
« on: March 22, 2022, 04:15:57 PM »
Hello,
I tried the last days to understand why jogging incremental with onscreen buttons vs extern buttons does not have the same step size.

When I change the step size over the GUI button then external button and onscreen make the same step size.
=> Everything like it should be

When I change via an additional external button the step size then jogging with external button makes the right step size
but onscreen buttons make the last onscreen set step size regardless that the onscreen display of step increment on the GUI is changed by the external button.

Simplified said why is "2022-03-22 20:37:25.551 - API: mcJogIncStart(inst = 0, axis = 2, inc = 1.0000) (Mach4GUI Button)" not changed by the external button step increment change?

Can somebody tell me what I miss here?
Some Logging and Code below.

Thanks

Gerhard

OnScreen Button Increment Toogle:
Code: [Select]
2022-03-22 20:36:34.823 - API: mcJogSetInc(inst = 0, axis = 0, inc = 0.5000) (unknown caller)
2022-03-22 20:36:34.824 - API: mcJogSetInc(inst = 0, axis = 1, inc = 0.5000) (unknown caller)
2022-03-22 20:36:34.824 - API: mcJogSetInc(inst = 0, axis = 2, inc = 0.5000) (unknown caller)
2022-03-22 20:36:34.824 - API: mcJogSetInc(inst = 0, axis = 3, inc = 0.5000) (unknown caller)
2022-03-22 20:36:34.825 - API: mcJogSetInc(inst = 0, axis = 4, inc = 0.5000) (unknown caller)
2022-03-22 20:36:34.825 - API: mcJogSetInc(inst = 0, axis = 5, inc = 0.5000) (unknown caller)
2022-03-22 20:36:35.464 - API: mcJogSetInc(inst = 0, axis = 0, inc = 0.1000) (unknown caller)
2022-03-22 20:36:35.464 - API: mcJogSetInc(inst = 0, axis = 1, inc = 0.1000) (unknown caller)
2022-03-22 20:36:35.465 - API: mcJogSetInc(inst = 0, axis = 2, inc = 0.1000) (unknown caller)
2022-03-22 20:36:35.465 - API: mcJogSetInc(inst = 0, axis = 3, inc = 0.1000) (unknown caller)
2022-03-22 20:36:35.465 - API: mcJogSetInc(inst = 0, axis = 4, inc = 0.1000) (unknown caller)
2022-03-22 20:36:35.466 - API: mcJogSetInc(inst = 0, axis = 5, inc = 0.1000) (unknown caller)

My external Button:
Code: [Select]
2022-03-22 20:36:47.619 - Signal id 4, (Input #3), changed from LOW to HIGH.
2022-03-22 20:36:47.620 - API: mcJogSetInc(inst = 0, axis = 0, inc = 0.5000) (unknown caller)
2022-03-22 20:36:47.620 - API: mcJogSetInc(inst = 0, axis = 1, inc = 0.5000) (unknown caller)
2022-03-22 20:36:47.620 - API: mcJogSetInc(inst = 0, axis = 2, inc = 0.5000) (unknown caller)
2022-03-22 20:36:47.620 - API: mcJogSetInc(inst = 0, axis = 3, inc = 0.5000) (unknown caller)
2022-03-22 20:36:47.620 - API: mcJogSetInc(inst = 0, axis = 4, inc = 0.5000) (unknown caller)
2022-03-22 20:36:47.620 - API: mcJogSetInc(inst = 0, axis = 5, inc = 0.5000) (unknown caller)
2022-03-22 20:36:48.021 - Signal id 4, (Input #3), changed from HIGH to LOW.
2022-03-22 20:36:51.017 - Signal id 5, (Input #4), changed from LOW to HIGH.
2022-03-22 20:36:51.018 - API: mcJogSetInc(inst = 0, axis = 0, inc = 0.1000) (unknown caller)
2022-03-22 20:36:51.018 - API: mcJogSetInc(inst = 0, axis = 1, inc = 0.1000) (unknown caller)
2022-03-22 20:36:51.018 - API: mcJogSetInc(inst = 0, axis = 2, inc = 0.1000) (unknown caller)
2022-03-22 20:36:51.019 - API: mcJogSetInc(inst = 0, axis = 3, inc = 0.1000) (unknown caller)
2022-03-22 20:36:51.019 - API: mcJogSetInc(inst = 0, axis = 4, inc = 0.1000) (unknown caller)
2022-03-22 20:36:51.019 - API: mcJogSetInc(inst = 0, axis = 5, inc = 0.1000) (unknown caller)
2022-03-22 20:36:51.395 - Signal id 5, (Input #4), changed from HIGH to LOW.

Code from external button:
Code: [Select]
[mc.ISIG_INPUT3] = function (state)
if(state == 1) then
mc.mcJogSetInc(inst, mc.X_AXIS, 0.5);
mc.mcJogSetInc(inst, mc.Y_AXIS, 0.5);
mc.mcJogSetInc(inst, mc.Z_AXIS, 0.5);
mc.mcJogSetInc(inst, mc.A_AXIS, 0.5);
mc.mcJogSetInc(inst, mc.B_AXIS, 0.5);
mc.mcJogSetInc(inst, mc.C_AXIS, 0.5);
end
end,

OnScreenButton Jogging:
Code: [Select]
2022-03-22 20:37:25.551 - API: mcJogIncStart(inst = 0, axis = 2, inc = 1.0000) (Mach4GUI Button)
2022-03-22 20:37:25.551 - Attempt transition from "Idle" on event "Jog" axis.cpp:585
2022-03-22 20:37:25.551 - Signal id 1127, (Jog Enabled), changed from HIGH to LOW.
2022-03-22 20:37:25.551 - S_IDLE_on_exit
2022-03-22 20:37:25.551 - Signal id 1172, (Machine Idle), changed from HIGH to LOW.
2022-03-22 20:37:25.552 - ACTION_start_jogging
2022-03-22 20:37:25.552 - S_JOGGING_on_entry
2022-03-22 20:37:25.867 - Attempt transition from "Jogging" on event "Stop Jog" controller.cpp:1815
2022-03-22 20:37:25.867 - S_JOGGING_on_exit
2022-03-22 20:37:25.867 - S_FILE_RUNNING_stop_jogging
2022-03-22 20:37:25.867 - S_IDLE_on_entry
2022-03-22 20:37:25.867 - Signal id 1127, (Jog Enabled), changed from LOW to HIGH.
2022-03-22 20:37:25.871 - Signal id 1172, (Machine Idle), changed from LOW to HIGH.

External Button Jogging:
Code: [Select]
2022-03-22 20:37:31.702 - Signal id 13, (Input #12), changed from LOW to HIGH.
2022-03-22 20:37:31.702 - Signal id 173, (Jog Z+), changed from LOW to HIGH.
2022-03-22 20:37:31.702 - Attempt transition from "Idle" on event "Jog" axis.cpp:585
2022-03-22 20:37:31.703 - Signal id 1127, (Jog Enabled), changed from HIGH to LOW.
2022-03-22 20:37:31.703 - S_IDLE_on_exit
2022-03-22 20:37:31.703 - Signal id 1172, (Machine Idle), changed from HIGH to LOW.
2022-03-22 20:37:31.703 - ACTION_start_jogging
2022-03-22 20:37:31.703 - S_JOGGING_on_entry
2022-03-22 20:37:32.016 - Attempt transition from "Jogging" on event "Stop Jog" controller.cpp:1815
2022-03-22 20:37:32.016 - S_JOGGING_on_exit
2022-03-22 20:37:32.016 - S_FILE_RUNNING_stop_jogging
2022-03-22 20:37:32.016 - S_IDLE_on_entry
2022-03-22 20:37:32.017 - Signal id 1127, (Jog Enabled), changed from LOW to HIGH.
2022-03-22 20:37:32.021 - Signal id 1172, (Machine Idle), changed from LOW to HIGH.
2022-03-22 20:37:35.794 - Signal id 13, (Input #12), changed from HIGH to LOW.
Re: Mach4 Hobby mcJogSetInc GUI vs external Button
« Reply #1 on: March 26, 2022, 08:03:25 AM »
You need to create a custom jog function that reads the set increment with mcJogGetInc and performs the jogging. The built in Jog actions won’t read the value set by mcJogSetInc. These API calls set registers which you can see in the register diagnostics and I believe are more of a placeholder for custom jog stuff.