Hello Guest it is April 19, 2024, 10:59:10 AM

Author Topic: Please help with adding 0.1 to the current DRO value, using a button.  (Read 3452 times)

0 Members and 1 Guest are viewing this topic.

Offline Tarak

*
  •  229 229
    • View Profile
I have a button script set to do this:

y=GetDRO(1201)
SetOEMDRO (1201,y+0.1)

Instead of adding the 0.1 to the existing value, it changes the value to +0.1, any idea why?
Thanks
Darc

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Do this instead:

y=GetDRO(1201)
y=y+0.1
SetOEMDRO (1201,y)

scott


fun times

Offline Tarak

*
  •  229 229
    • View Profile
Thanks Scott.
I tried the code you gave me, for some reason it still just enters 0.1, instead of adding 0.1 to the value.
It wouldn't have anything to do with the fact I don't have the driver installed.....would it?

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
The only thing I can think of, is that what ever value you have put into 1201 initially, is not "Staying".......  are you hitting enter after you change its value?
The only way, you would update that same dro to = 0.01 would be to pull in a value of "0" from it to start with...

Pull out the VB editor, and walk through the code (keeping the page you have the dro on, up). So if you put "1" in the dro manually, then step through the code, Y should equal 1 after you pass the very first line on mabey on the first line. Then on the second line Y to the right of the = should equal 1, and y to the left should be 1.01.......

Also Look at you code again, I see your first DRO is GetDRO, and it should be GetOEMDRO...Assuming your getting User dros in both places

i.e.

y=GetOEMDRO(1201)
y=y+0.1
SetOEMDRO(1201,y)

Scott
fun times

Offline Tarak

*
  •  229 229
    • View Profile
Yeah, you were right I changed GetDRo to GetOEMDRO and it worked, thanks..
I'm slowly getting the hang of VB.................verrrry slooowwwwlllyyy.....
Thanks again Scott.