Go Down

Topic: Help with ModBus RTU Master-Slave: SimpleModbus [SOLVED] (Read 386564 times) previous topic - next topic

ismailsinapli

#810
Aug 25, 2019, 10:46 pm Last Edit: Aug 25, 2019, 11:19 pm by ismailsinapli
Hi JPrust,

Maybe you will need this line of code:
Code: [Select]

modbus_configure(&Serial, 19200, SERIAL_8N2, DEVICE_ID, TxEnablePin, HOLDING_REGS_SIZE, holdingRegs);
// modbus_update_comms(baud, byteFormat, id) is not needed but allows for easy update of the
// port variables and slave id dynamically in any function.
modbus_update_comms(19200, SERIAL_8N2, 1);




As you declared in your code, register of VAL_LED is READ register (address 0) and VAL_POT(address 1) is WRITE register. So, in HMI you can access with address 40001 for VAL_LED (HMI write value into this register such as button input) and 40002 for VAL_POT(HMI will read from this register such as number display?).

Why 40001 and 40002? Because in Delta HMI register address, address 0 will be 40001, so if you need to access register 10, it will be 40011 in Delta HMI. and the data will be WORD.

Hop it will help.

Thanh Nguyen

Hi JPrust,

Maybe you will need this line of code:
Code: [Select]

modbus_configure(&Serial, 19200, SERIAL_8N2, DEVICE_ID, TxEnablePin, HOLDING_REGS_SIZE, holdingRegs);
// modbus_update_comms(baud, byteFormat, id) is not needed but allows for easy update of the
// port variables and slave id dynamically in any function.
modbus_update_comms(19200, SERIAL_8N2, 1);


As you declared in your code, register of VAL_LED is READ register (address 0) and VAL_POT(address 1) is WRITE register. So, in HMI you can access with address 40001 for VAL_LED (HMI write value into this register such as button input) and 40002 for VAL_POT(HMI will read from this register such as number display?).

Why 40001 and 40002? Because in Delta HMI register address, address 0 will be 40001, so if you need to access register 10, it will be 40011 in Delta HMI. and the data will be WORD.

Hop it will help.

Thanh Nguyen

Hi JPrust,

Maybe you will need this line of code:
Code: [Select]

modbus_configure(&Serial, 19200, SERIAL_8N2, DEVICE_ID, TxEnablePin, HOLDING_REGS_SIZE, holdingRegs);
// modbus_update_comms(baud, byteFormat, id) is not needed but allows for easy update of the
// port variables and slave id dynamically in any function.
modbus_update_comms(19200, SERIAL_8N2, 1);


As you declared in your code, register of VAL_LED is READ register (address 0) and VAL_POT(address 1) is WRITE register. So, in HMI you can access with address 40001 for VAL_LED (HMI write value into this register such as button input) and 40002 for VAL_POT(HMI will read from this register such as number display?).

Why 40001 and 40002? Because in Delta HMI register address, address 0 will be 40001, so if you need to access register 10, it will be 40011 in Delta HMI. and the data will be WORD.

Hop it will help.

Thanh Nguyen

Hi JPrust,

Maybe you will need this line of code:
Code: [Select]

modbus_configure(&Serial, 19200, SERIAL_8N2, DEVICE_ID, TxEnablePin, HOLDING_REGS_SIZE, holdingRegs);
// modbus_update_comms(baud, byteFormat, id) is not needed but allows for easy update of the
// port variables and slave id dynamically in any function.
modbus_update_comms(19200, SERIAL_8N2, 1);


As you declared in your code, register of VAL_LED is READ register (address 0) and VAL_POT(address 1) is WRITE register. So, in HMI you can access with address 40001 for VAL_LED (HMI write value into this register such as button input) and 40002 for VAL_POT(HMI will read from this register such as number display?).

Why 40001 and 40002? Because in Delta HMI register address, address 0 will be 40001, so if you need to access register 10, it will be 40011 in Delta HMI. and the data will be WORD.

Hop it will help.

Thanh Nguyen

Hi vietnam friend you made the tube modbus communication dop panel, send me the arduino library
Mail.:  ismailsef@gmail.com

Send me the dop panel delta display software + arduino libraries + circuit diagram

ismailsinapli

Hi my  friend you made the tube modbus communication dop panel program send me the arduino library

https://youtu.be/94DY74uyIJk

Go Up