331
General Mach Discussion / Re: Lathe turret, VB, PLC, MODBUS, Position
« on: November 17, 2009, 06:16:00 PM »
Hi Dustin,
You probably need to start reading some of the Modbus specs, it will help with the understanding.
X are discrete inputs. They connect to the outside world.
Y are discrete outputs. They connect to the outside world.
C are internal coils. Thinkof them as temporary memory.
With the addressing, Modbus has 2 schemes. 'Hex' addressing and '984' addressing.
So in 984 format the first C1 bit coil is located at address 16385. In hex format, the address of C1 is 0x4000 which is 16384.
Try to write to coil 16384 from Mach3.
I know it sounds really weird, but in 984 addressing each data type is offset by a certain amount depending on its data type. It was initially to do with how PLCs used to be built.
Mach uses hex addressing but in decimal form. So hex 4000 is decimal 16384
Ad to the holding registers DS, there addresses start at 0000 hex. or 400001 in 984.
I hope this is not to confusing.
Cheers,
Peter.
You probably need to start reading some of the Modbus specs, it will help with the understanding.
X are discrete inputs. They connect to the outside world.
Y are discrete outputs. They connect to the outside world.
C are internal coils. Thinkof them as temporary memory.
With the addressing, Modbus has 2 schemes. 'Hex' addressing and '984' addressing.
So in 984 format the first C1 bit coil is located at address 16385. In hex format, the address of C1 is 0x4000 which is 16384.
Try to write to coil 16384 from Mach3.
I know it sounds really weird, but in 984 addressing each data type is offset by a certain amount depending on its data type. It was initially to do with how PLCs used to be built.
Mach uses hex addressing but in decimal form. So hex 4000 is decimal 16384
Ad to the holding registers DS, there addresses start at 0000 hex. or 400001 in 984.
I hope this is not to confusing.
Cheers,
Peter.