Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 01:24:54 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Easy way to always have a positive value in a DRO field
Pages: 1   Go Down
Print
Author Topic: Easy way to always have a positive value in a DRO field  (Read 1250 times)
0 Members and 1 Guest are viewing this topic.
Darc
Active Member

Offline Offline

Posts: 177


View Profile
« on: May 09, 2008, 04:34:31 AM »

Is there an easy way to always force a positive value into a DRO, I have a small calculator I've made for working out a lead (similar to a drill flute), it works great but it returns a negative value.
Is it possible to change the following line to make it always output a positive value?

SetOEMDRO (1203,3.141592654*Ø/Tan(AngleinRadians)) 'This normally works out to a negative value, but the value in a positive is correct.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #1 on: May 09, 2008, 07:30:35 AM »

Yes,

x=ABS(SetOEMDRO (1203,3.141592654*Ø/Tan(AngleinRadians)))

Absoulte value function, always positive.

scott
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Darc
Active Member

Offline Offline

Posts: 177


View Profile
« Reply #2 on: May 09, 2008, 03:57:58 PM »

Yet again, Thanks scott, works well. Now that I look at the function Abs, I think you may of told me this once before, sorry.
Darc
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!