Hello Guest it is May 10, 2024, 04:42:13 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Bill_O

421
Mach4 General Discussion / Re: changing value in CurrentX dro
« on: February 28, 2019, 12:26:15 PM »
tom,

i need to do it within a lua script
in mach3 when i used g92 it behaved much different than it does in mach4
it all has to do with some positioning that i need to adjust multiple times

bill

422
Mach4 General Discussion / changing value in CurrentX dro
« on: February 28, 2019, 12:13:30 PM »
I have tried several things to get a specific number in the CurrentX dro.
G92 works but it also is an offset which messes up some other things.

423
Mach4 General Discussion / Re: write to a register
« on: February 28, 2019, 08:12:29 AM »
rhtuttle,

thanks
i knew it was something simple in how i typed it but did not know what.

thanks again,
Bill

424
Mach4 General Discussion / Re: write to a register
« on: February 27, 2019, 01:56:51 PM »
craig,

yes i have read it.
i thought the 'EncScale' was a variable
the largest problem i am having with this script is the line "local hreg = mc.mcRegGetHandle(inst, 'iRegs0/EncScale')"
this is the exact same line i have in another script "local hreg = mc.mcRegGetHandle(inst, 'Encoder_0')"
the second works the first does not
both are registers

bill

425
Mach4 General Discussion / write to a register
« on: February 27, 2019, 10:08:07 AM »
Ok.
Yesterday I had a script that would read a register then set another register.
I realized that is not what I needed and deleted it.
Now I need to read a dro then write the value to a register.
Of course it is not working so I am once again asking for help.
The script editor is telling me the problem is the last line.
Here is the code:

--read value from dro
local EncScale = scr.GetProperty('droEncScale', 'Value')
--set register handle
local hreg = mc.mcRegGetHandle(inst, 'iRegs0/EncScale')
--set register
local mc.mcRegSetValue(hreg,'EncScale')


BTW how to do this will be written down this time.

Thanks,
Bill

426
Mach4 General Discussion / Re: pmc / plc
« on: February 27, 2019, 08:05:46 AM »
Mike,

Sorry I did not say so earlier.
It works great now.
Its amazing how things work when you do everything you are supposed to do.
LOL

Bill

427
Mach4 General Discussion / Re: code problem
« on: February 26, 2019, 04:12:17 PM »
jbuehn,

Works perfect now.

Thanks,
Bill

428
Mach4 General Discussion / Re: code problem
« on: February 26, 2019, 03:18:39 PM »
When I run this code it crashes Mach4.

429
Mach4 General Discussion / Re: code problem
« on: February 26, 2019, 12:21:17 PM »
Robert,

Thanks. I will give it a try.

Bill

430
Mach4 General Discussion / code problem
« on: February 26, 2019, 10:32:45 AM »
The attached code is giving me a nil value on the first line.
What do I have wrong.