Hello Guest it is November 09, 2024, 08:00:18 AM

Author Topic: Softlimits on RnR card---, min-max input value  (Read 5634 times)

0 Members and 1 Guest are viewing this topic.

Softlimits on RnR card---, min-max input value
« on: February 13, 2021, 03:06:40 PM »
I use a USB motion controller for Mach 3. These do not support use of softlimits unfortunately.
I input all my positions manually on the DRO on a custom screenset.
BUT I would like to know if anyone has any experience on solving the issue with the missing softlimits?
Is there a way of setting a max-min value for each DRO input value, and have a pop-up msg if a value is entered outside this range, by use of a basic script?


Best regards
Roy

Offline TPS

*
  •  2,528 2,528
Re: Softlimits on RnR card---, min-max input value
« Reply #1 on: February 14, 2021, 09:51:18 AM »
there is no possibilty (ok i do not know one), to set a Min/Max range for a partucular DRO.

here:
https://www.machsupport.com/forum/index.php?topic=36213.msg247828#msg247828

i posted a numeric Keyboard Input possibilty via VB, there is would be easy to inplement.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Softlimits on RnR card---, min-max input value
« Reply #2 on: February 14, 2021, 01:10:40 PM »
Thanks for the reply Thomas.
I use your onscreen keyboard, and it is GREAT, thanks man.

So making a couple of lines with a >= or =< would be harder to implement in the keyboard macro as it would have to know what DRO it is writing to.
If there was a specific macro that was called for each axis, would it be possible then?

Like:
 numerkkeyboard_x_axis.m1s
 numerkkeyboard_y_axis.m1s
 numerkkeyboard_z_axis.m1s


BTW. I picked up the work on my table saw screenset, and the fingerjoint wizzard you made for me.
When I finish the sled , I will make a YT video on it. If it is OK with you, I might shoot you an email with a couple of questions in a day or 2.
Have a great day Sir

Best regards
Roy


there is no possibilty (ok i do not know one), to set a Min/Max range for a partucular DRO.

here:
https://www.machsupport.com/forum/index.php?topic=36213.msg247828#msg247828

i posted a numeric Keyboard Input possibilty via VB, there is would be easy to inplement.
« Last Edit: February 14, 2021, 01:14:14 PM by corydoras »
Re: Softlimits on RnR card---, min-max input value
« Reply #3 on: February 14, 2021, 01:36:54 PM »
Just did a little more testing, and it actually turns out that the Softlimit switches work when jogging the axis in manual mode. But if you input a value outside the limits in the MDI, it moves beyond the softlimits.....hmmmmm funny

BR
Roy

Offline TPS

*
  •  2,528 2,528
Re: Softlimits on RnR card---, min-max input value
« Reply #4 on: February 15, 2021, 01:23:44 AM »
the macro "knows" allready witch DRO it has to write too. it knows it form the
function call:

   call NumericKeyboard(800)

because 800 (in this example) is the dro number

here:

Code: [Select]
'numeric Keyboard with MIN/MAX value
Function NumericKeyboard(ByVal DRONum as Integer , ByVal Min as Double , ByVal Max as Double) As Double
Dim title as String
value = GetOemDRO(DRONum)
title = Header


Begin Dialog UserDialog1 60,60, 105, 210, "Eingabe:"  , .Enable

PushButton 10, 10, 25, 25, "7", .but7
PushButton 40, 10, 25, 25, "8", .but8
PushButton 70, 10, 25, 25, "9", .but9

PushButton 10, 40, 25, 25, "4", .but4
PushButton 40, 40, 25, 25, "5", .but5
PushButton 70, 40, 25, 25, "6", .but6

PushButton 10, 70, 25, 25, "1", .but1
PushButton 40, 70, 25, 25, "2", .but2
PushButton 70, 70, 25, 25, "3", .but3

PushButton 10, 100, 25, 25, ".", .butD
PushButton 40, 100, 25, 25, "0", .but0
PushButton 70, 100, 25, 25, "<-", .butB

PushButton 10, 130, 25, 25, "+/-", .butN
PushButton 40, 130, 25, 25, "Del", .butDel

TextBox 10, 160, 85, 18, .FText
PushButton 10, 185, 40, 21,"OK", .OK
CancelButton 55, 185, 40, 21
End Dialog


Dim Dlg1 As UserDialog1

Dlg1.FText = CStr(value)
x = Dialog( Dlg1 )

NumericKeyboard = CDbl(Dlg1.FText)
If CDbl(Dlg1.FText) < Min Then NumericKeyboard = Min
If CDbl(Dlg1.FText) > Max Then NumericKeyboard = Max

SetOEMDro(DRONum,NumericKeyboard)
End Function


is the code with MIN/MIX check included

the call would be:
Code: [Select]
  call NumericKeyboard(800,0,400)

with   call NumericKeyboard(DRO number,MIN,MAX)



this part of the code:
Code: [Select]
NumericKeyboard = CDbl(Dlg1.FText)
If CDbl(Dlg1.FText) < Min Then NumericKeyboard = Min
If CDbl(Dlg1.FText) > Max Then NumericKeyboard = Max

SetOEMDro(DRONum,NumericKeyboard)
does the check AND writes the value into the given DRO number
« Last Edit: February 15, 2021, 01:28:27 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Softlimits on RnR card---, min-max input value
« Reply #5 on: February 15, 2021, 10:48:33 AM »
Hello Thomas

I tried this version of the numeric keyboard with the min max function, and it works great.
In the beguinning I had some issues, but I found that I had aso deleted the commands after the "end function"

Thanks again Sir

BR
Roy
« Last Edit: February 15, 2021, 10:58:35 AM by corydoras »