I think you are confusing the terms:
slave ID is usually used to specify the device on the Modbus Network. in the code that you sent is hardcoded to be 1:
register 400001 and 300001 to me sounds like different function code registers. are you sure that the Masibus Old and New scanner uses different addresses?
some background on Modbus:
Modbus works using specified registry addresses, and the called function codes:
so, 30001 is the first address on the Input registers, and 40001 is the first one on the Holding registers.
the difference is that holding registers are Read/Write and Input registers are only Read.
so, if you want to access register 30001 you need to point to addres 0 of Input registers using function code 4 (Read Input registers).
the program that you sent is accessing address 0 using function code 3 (Read Holding registers) which happens to be register 40001:
If you are sure that you need to read register 30001 then use the appropriate function code:
Also, some Modbus devices starts counting on 0, others on 1 just to take into consideration.