Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: krisverheyen on June 20, 2006, 04:11:08 PM
-
Hello,
I noticed some people did use analog inputs with a (modbus) plc (brian? :) )
I am planning to use a modbus (coupler or plc). How does this work exactly.
I did check out the wiki pages on modbus, but it's not all clear to me.
If my analog modules are 8 bits, do i lose 8 oemtrigger inputs or so?
are is it better to use direct access in scripting.
What i want to do is use an hall efect 3 axis joystick for jogging.
any hints?
Thanks,
Kris
-
To get the data from the analog input you look at the input register. So an analog register is read by Mach3 and is stored by Mach 3 till the next time mach3 reads the register. To get the data from the register you do the following:
Getinput(64)
64 is the first register that you can use for an analog input register.
If it is an 32bit or 8 bit analog is going to change the max valuse that you get from the analog input...
hope that helps
-
Hello Brian,
Yes this helps, thank you.
Altough i'm not completely shure of what to do when more analog values are needed.
Say it was an 8-bit register, do i need to reed input 72 (=64+8) for the next value,
are does this mapping settings in modbus setup make it so that i need to read input 65
that is what i think actually.
Kris.
-
each register is a holding register when you are doing analog. So for a DL05 PLC I know that 10V is 4096 and 0V is 0... so any voltage in that range will be a value in register 64 from 0 - 4096. If you had two analog inputs register 64 & register 65 would have values from 0 - 4096... As you can see it only takes one register to get one analog channel :) .
-
Ok, thank you
I was guessing it would be that way
greetings