AdvancedHMI Software

General Category => Support Questions => Topic started by: zipfrog2022 on February 12, 2024, 01:21:17 PM

Title: Modbus 16bit addresses
Post by: zipfrog2022 on February 12, 2024, 01:21:17 PM
I am working on setting up some fairly basic actuator controls. All my single bit items work fine. What I need to know is how to read a 16bit address or write a 16bit address.

To send a operation command lets say for open / closed its function code 06, offset is 4096, bit 0= open, bit 1=closed, bit 2= setpoint.

How would I read these or write these. I would like to either use selector switch to change from open close using the bits above or push button to send the open / closed commands.

Help understanding how to work with the 16bit addresses would be greatly appreciated.

Thanks
Title: Re: Modbus 16bit addresses
Post by: Archie on February 12, 2024, 01:31:03 PM
AdvancedHMI uses function code 3 to read 16 bit registers and function code 16 to write them.

Normally you use addresses in the 40000+ range, such as 40001

I
Title: Re: Modbus 16bit addresses
Post by: zipfrog2022 on February 12, 2024, 06:04:36 PM
Can you not use function code 6? 16 is to write multiple registers and 6 is to write a single register.
AdvancedHMI uses function code 3 to read 16 bit registers and function code 16 to write them.

Normally you use addresses in the 40000+ range, such as 40001

I
Title: Re: Modbus 16bit addresses
Post by: Archie on February 12, 2024, 07:16:33 PM
I checked the code and it will use function code 6 if there is only a single register to read.
Title: Re: Modbus 16bit addresses
Post by: zipfrog2022 on February 13, 2024, 12:03:50 AM
Ok

Thank You
I checked the code and it will use function code 6 if there is only a single register to read.