Hello Guest it is March 28, 2024, 10:20:09 AM

Author Topic: Showing selected axis  (Read 11775 times)

0 Members and 1 Guest are viewing this topic.

Offline Pedio

*
  •  200 200
    • View Profile
Showing selected axis
« on: November 01, 2015, 02:39:28 PM »
Is there a way I can show what axis is selected for Jogging on a button? I would like to put a background behind the active axis DRO box if it is the one selected for jogging.

Thanks,
Peter

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Showing selected axis
« Reply #1 on: November 03, 2015, 04:53:50 AM »
Is there a way I can show what axis is selected for Jogging on a button? I would like to put a background behind the active axis DRO box if it is the one selected for jogging.

Thanks,
Peter

Didnt spot this thread,

Can you post a bit more info? where is the signal coming from to say what axis you are on.

DazTheGas
New For 2022 - Instagram: dazthegas

Offline Pedio

*
  •  200 200
    • View Profile
Re: Showing selected axis
« Reply #2 on: November 03, 2015, 08:17:05 AM »
Is there a way I can show what axis is selected for Jogging on a button? I would like to put a background behind the active axis DRO box if it is the one selected for jogging.

Thanks,
Peter

Didnt spot this thread,

Can you post a bit more info? where is the signal coming from to say what axis you are on.

DazTheGas

Daz,

When I use my ShuttlePro pendant the center wheels will move one axis at a time. I have configured the three buttons to be the axis selection. For example if I select the X axis and then move the wheel on the ShuttlePro it will move the X axis. The problem (albeit small problem) is that later I don't remember which axis has been selected so I end up selecting an axis again before moving the wheel.

Since my screen is right beside the machine it would be nice if I could have an indication as to which axis is selected. I was thinking of a change of the color of a button or place a second button behind the axis DRO.

Thanks for any help.

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Showing selected axis
« Reply #3 on: November 03, 2015, 08:25:04 AM »
I dont know much about the shuttle setup, what tells mach4 the axis - is it through the shuttle config or mach inputs config?? (perhaps I buy one)

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Showing selected axis
« Reply #4 on: November 03, 2015, 11:23:34 AM »
I opened and watched the log file and noticed a pattern.

So then wrote a function and put it at the bottom of the plc script to parse out the current Axis data, ugly but it does show how to strip out data from a log file.

There does not seem to be a "Lua mc.mc command / for that API call" but the log file shows the API. So not a great way to do it, as it is checking every line the log file creates. and only reports the single line with the updated axis selected (Note: it does have to jog to show up in the log)

but it is a good lesson for me in scripting and Lua, Thanks

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Showing selected axis
« Reply #5 on: November 03, 2015, 01:38:28 PM »
What about the profile or registry for the shuttle, does any of the profile change between button presses, ie

If mcprofilegetint  shuttlepro0 -> input1 == 1 then do something

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Showing selected axis
« Reply #6 on: November 03, 2015, 02:31:29 PM »
I am told that if you use the mpgaxis choices in the shuttle pro setup that you can.  ???
and you will have to setup mpg in your screen set too, I did not have any luck, as I have/had mine all working for my mpg dials

Could not get jog or mpg too step for me (center dial does nothing, outer dial worked but would not change axis on button presses)
had to go back to the jog selection for the axis button selections to work for me.
inner and outer dial worked a few revisions ago just fine.  ::)

but this did confirm and display what button press i selected as long as i used the mpgaxis option

    local inst = mc.mcGetInstance(inst)
    local mpg, rc
    mpg, rc = mc.mcMpgGetAxis(inst, 1); -- in this case mpg1
    mc.mcCntlSetLastError(inst, 'mpg axis = '.. tostring(mpg));

maybe i need a higher number axis selection, as i am using 3 now for mpg's and there might be some conflict with my current ones.

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Showing selected axis
« Reply #7 on: November 03, 2015, 02:42:35 PM »
I've just ordered one so I can have a play, I do love my toys :-)

DazTheGas
New For 2022 - Instagram: dazthegas

Offline Pedio

*
  •  200 200
    • View Profile
Re: Showing selected axis
« Reply #8 on: November 03, 2015, 03:12:44 PM »
I am told that if you use the mpgaxis choices in the shuttle pro setup that you can.  ???
and you will have to setup mpg in your screen set too, I did not have any luck, as I have/had mine all working for my mpg dials

Could not get jog or mpg too step for me (center dial does nothing, outer dial worked but would not change axis on button presses)
had to go back to the jog selection for the axis button selections to work for me.
inner and outer dial worked a few revisions ago just fine.  ::)

but this did confirm and display what button press i selected as long as i used the mpgaxis option

    local inst = mc.mcGetInstance(inst)
    local mpg, rc
    mpg, rc = mc.mcMpgGetAxis(inst, 1); -- in this case mpg1
    mc.mcCntlSetLastError(inst, 'mpg axis = '.. tostring(mpg));

maybe i need a higher number axis selection, as i am using 3 now for mpg's and there might be some conflict with my current ones.

The center dial is set by the jog increment you set on your screen. Be careful - if you set it to a big increment you can move the machine a lot. Each small increment move of the wheel moves the machine by one jog increment. I keep mine set at .01.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Showing selected axis
« Reply #9 on: November 03, 2015, 03:13:25 PM »
the vistacnc pendants are really good to daz they have 2 for M4