Hello Guest it is March 29, 2024, 04:26:20 AM

Author Topic: Display WHOLE # Only in DRO  (Read 11266 times)

0 Members and 1 Guest are viewing this topic.

Display WHOLE # Only in DRO
« on: December 06, 2012, 07:50:47 PM »
Hey,
  Is there a way to display the whole number value (integer?) only in a  %.0f  DRO without rounding up to the next digit ?
For example:
   Put 2 DRO's on screen w/the same OEM or User Code.
  Set #1 as 4 decimal place, and #2 as 0 decimal places.
If #1 shows 1.8, #2 will round up to 2
How can I capture just the whole number in #1.
Possible ?
Thanks

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Display WHOLE # Only in DRO
« Reply #1 on: December 06, 2012, 08:45:50 PM »
Use a User DRO for the integer, and use the macropump to read the other DRO, trim off the decimals, and write to the User DRO.
Not terribly elegant, but it should work, no?
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Display WHOLE # Only in DRO
« Reply #2 on: December 06, 2012, 08:50:34 PM »
Ha ... sounds quite elegant !
How do I trim with the pump ?
Example ? ? ?
Thanks Ger
Russ

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Display WHOLE # Only in DRO
« Reply #3 on: December 06, 2012, 09:07:01 PM »
The interger function from what I see in Machscreen is broken. You get some weird number displayed.

IF you are populating a User dro then you could ROund down the number then send to the DRO .

OEMDROs most are control by the screen format.

(;-) TP
Re: Display WHOLE # Only in DRO
« Reply #4 on: December 06, 2012, 09:13:25 PM »
IF you are populating a User dro then you could ROund down the number then send to the DRO .

Yep ... User DRO.  How can I round it dwn internally ?
Doing it manually now, gotta be a better way.

Both of you are encouraging.
Reading VB stuff now.....a lot like chineese ::)
Re: Display WHOLE # Only in DRO
« Reply #5 on: December 06, 2012, 09:20:44 PM »
I found this, but can't seem to relate it to "our" language.
http://www.vbforums.com/showthread.php?379158-How-to-Remove-Decimal-Part
Re: Display WHOLE # Only in DRO
« Reply #6 on: December 06, 2012, 09:29:38 PM »
... and this in the Mach book.
What would the proper syntax be ? ? ?

Wish I had a better grip on this.
Thanks

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Display WHOLE # Only in DRO
« Reply #7 on: December 06, 2012, 09:33:15 PM »
Place something like this in the macropump macro.


DROInteger=CStr(GetOemDro(xx))
Length = Len(DROInteger)
For X = 1 To Length Step 1
lstring=Left(DROInteger,X)
If Right(lstring,1) = "." Then
NewLength = x-1
Exit For
End If
Next X

WholeNo=CInt(Left(DROInteger, NewLength))

SetOemDRO(xx)
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Display WHOLE # Only in DRO
« Reply #8 on: December 06, 2012, 09:48:44 PM »
Hi Ger,
 tried it, not working.
Changed OEM to User   ... no difference.

Here it is :
DROInteger=CStr(GetUserDro(1107))
Length = Len(DROInteger)
For X = 1 To Length Step 1
lstring=Left(DROInteger,X)
If Right(lstring,1) = "." Then
NewLength = x-1
Exit For
End If
Next X

WholeNo=CInt(Left(DROInteger, NewLength))

SetUserDRO(1106)               

Getting  "ERROR on line: 24 - Argument not optional"

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Display WHOLE # Only in DRO
« Reply #9 on: December 06, 2012, 09:55:24 PM »
Oops.
Try SetUserDRO(xx, WholeNo)
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html