Hello Guest it is April 28, 2024, 08:26:48 AM

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: 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

422
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

423
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

424
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

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

Works perfect now.

Thanks,
Bill

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

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

Thanks. I will give it a try.

Bill

428
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.

429
Mach4 General Discussion / Re: reading and writing to registers
« on: February 26, 2019, 08:09:54 AM »
Craig,

I had the registers taken care of but thanks for making sure I had it all.
I will work on the rest in a little while.

Thanks,
Bill

430
Mach4 General Discussion / Re: pmc / plc
« on: February 26, 2019, 08:06:43 AM »
Mike,

Thanks for the help.
I will give it a shot in a while.

Bill