Hello Guest it is March 29, 2024, 01:18:28 AM

Author Topic: Setting Soft Limits On as the Default  (Read 6613 times)

0 Members and 1 Guest are viewing this topic.

Setting Soft Limits On as the Default
« on: May 20, 2016, 03:53:15 PM »
Is there a way to set the soft limits to ON as the default?

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Setting Soft Limits On as the Default
« Reply #1 on: May 22, 2016, 06:22:24 AM »
You will need to add the mcSoftLimitSetState command in the screen load script. (This is accessed from the screen editor)

this command is an as per axis command, so for example if you only needed soft limits for axis 0 (X) then you would use mc.mcSoftLimitSetState(inst, 0, 1)

inst = our controller instance
0 = our axis number
1 = on and 0 = off

mc.mcSoftLimitSetState(inst, 0, 1)
mc.mcSoftLimitSetState(inst, 1, 1)
mc.mcSoftLimitSetState(inst, 2, 1)

this would turn on XYZ on my machine.

mc.mcSoftLimitSetState(inst, 0, 0)
mc.mcSoftLimitSetState(inst, 1, 0)
mc.mcSoftLimitSetState(inst, 2, 0)

and this would turn them back off

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Setting Soft Limits On as the Default
« Reply #2 on: May 22, 2016, 09:14:26 PM »
Thanks Daz,  I will try it out.....

BTW, great Youtube videos.  They were very helpful in setup.
Re: Setting Soft Limits On as the Default
« Reply #3 on: May 23, 2016, 09:34:47 AM »
0 = our axis number

Is this truly axis number or is it motor number?
i.e. 0=X ... 5=C
or
0=Motor 0 ... 5=Motor 5
?

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Setting Soft Limits On as the Default
« Reply #4 on: May 23, 2016, 10:28:44 AM »
It is the AXIS number as per API Docs, you assign motors to an axis,

IE - I have motors 1 and 3 assigned to axis 1, by doing this mach knows to do whatever on both motors.

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Setting Soft Limits On as the Default
« Reply #5 on: May 23, 2016, 02:08:51 PM »
You will need to add the mcSoftLimitSetState command in the screen load script. (This is accessed from the screen editor)

Daz,  Can you be more specific on what file to edit?  I went into the menus:  Operator > Edit Screen

But I do not see where I can add edit the screen load script from within there.

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Setting Soft Limits On as the Default
« Reply #6 on: May 23, 2016, 02:46:43 PM »
New For 2022 - Instagram: dazthegas
Re: Setting Soft Limits On as the Default
« Reply #7 on: May 23, 2016, 03:22:19 PM »
Don't know how I missed that one...   ::)  

Works as needed!
Thanks again Daz...
« Last Edit: May 23, 2016, 03:29:39 PM by da40flyer »

Offline Stuart

*
  •  311 311
    • View Profile
Re: Setting Soft Limits On as the Default
« Reply #8 on: June 29, 2016, 11:30:11 AM »
Daz

I may be talking rubbish here as I am not up to speed with LUA but could the default state of the button be changed from its off state to on ( maybe a true/false thing or a 0 1 )

Just me thinking out loud

Stuart

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Setting Soft Limits On as the Default
« Reply #9 on: June 29, 2016, 01:19:27 PM »
If you mean the toggle button then yes this can be set in the button properties tab to either up or down.

DazTheGas
New For 2022 - Instagram: dazthegas