71
Support Questions / Re: Modbus 16bit addresses Read Only
« Last post by cajunman64 on February 13, 2024, 09:13:39 AM »Thanks I will try it out when I get back on shift tonight
I checked the code and it will use function code 6 if there is only a single register to read.
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
in conjunction with the subtract you want to use a logical AND.
ModbusTCPCom1.Write("40001", Value AND (65535 - 2 ^ (b_Num - 1)))
I can't test that right now, but the 65535 assumes it is an unsigned 16 bit integer, it may need to be a 32767