Hello Guest it is April 20, 2024, 08:29:53 AM

Author Topic: Getting some odd values from MACH variables - is this normal?  (Read 2606 times)

0 Members and 1 Guest are viewing this topic.

Offline simpson36

*
  •  1,369 1,369
    • View Profile

Admittedly some rather esoteric stuff, but I am pulling the Z axis DRO using "GetOemDRO(844)"

The Screen DRO shows .100 and the actual position is the result of a "G0 Z.100" move.  The variable read returns something like 0.09999999999*********xx

In the app, I was comparing a user entered value (0.100) with the DRO value (should have been .100) and of course it returns false. A work around was easy enough, but I was just wondering if this is normal or if I have done something inadvertently to effect MACHs internal calculation.

SECOND anomoly is that in  SetParam("VelocitiesZ",<value>) the value is not what gets put into the param. It is a divisor or somthing like that. I was shooting for a value of 16, but the resulting setting in the system was 960 I think. Ultimately thru experimentation I found that a value of 0.5 yeilded the desired speed of 16.

 I am just curious if one or both of these behaviors is normal or a glitch in dev ver 062.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Getting some odd values from MACH variables - is this normal?
« Reply #1 on: July 21, 2012, 08:38:30 AM »
HIYA Steve when dealing with values you pull out you need to format them to the same as the DRO you are pulling from. In native form you notice they are very long numbers when rounded up meet the same value as the DRO. NOrmal

You are trying to develop something using the Dev version and that is never a good thing(;-). I always develop on a known WORKING version of mach3. Then after I am finished and happy "try it" on the dev version. Sometimes the Dev ver works sometimes NOT. At least I know it is NOT the project I am working on.

I do not monkey with  the internals like axis parameters. So I have no info there  To me that is asking for troubles(;-) BUT I know where you are coming from you have to make it work somehow IF POSSIBLE. BUT if I were guessing I would say that the internals are ALL in metric form and you need to correct for imp.

Just a thought, (;-)TP
« Last Edit: July 21, 2012, 08:41:04 AM by BR549 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Getting some odd values from MACH variables - is this normal?
« Reply #2 on: July 21, 2012, 08:58:25 AM »
Further testing the setparam function. HERE on vista with V.062 it does NOT even work period(;-) so I can't help ya there.

(;-) TP
Re: Getting some odd values from MACH variables - is this normal?
« Reply #3 on: October 05, 2012, 11:20:40 AM »
Issue #1
You are dealing with a double (precision number).
See nFmt, page 61 Mach3 Macro Reference