AC800M Modbus: Use same Modbus FB the read / write different registers
Hello,
I setup a Modbus connection between my PLC (AC800M) and a flow sensor. The connection works, but I try to read multiple different registers with one MBRead function block (not simultaneously).
So a in one cycle I tried to read register 404010 (%MW4010), I'll get the right response (RD[1] = 3). After this it doesn't matter which start address I'll give this exact function block, RD[1] will always stay 3 although Ndr (New data received) will turn high so it does collect new data. It just reads the first register I asked.
Does this mean I have to use different instances of MBRead for every different register (Not next to each other) I like to read? (Same goes for MBWrite)
I know you can read multiple registers that are next to each other (404010 and 404011 for example), but I want to read different registers like 404010 and 403781 with the same function block. Is this possible or do I need to use multiple instances? Thanks in advance
I setup a Modbus connection between my PLC (AC800M) and a flow sensor. The connection works, but I try to read multiple different registers with one MBRead function block (not simultaneously).
So a in one cycle I tried to read register 404010 (%MW4010), I'll get the right response (RD[1] = 3). After this it doesn't matter which start address I'll give this exact function block, RD[1] will always stay 3 although Ndr (New data received) will turn high so it does collect new data. It just reads the first register I asked.
Does this mean I have to use different instances of MBRead for every different register (Not next to each other) I like to read? (Same goes for MBWrite)
I know you can read multiple registers that are next to each other (404010 and 404011 for example), but I want to read different registers like 404010 and 403781 with the same function block. Is this possible or do I need to use multiple instances? Thanks in advance
Answers
Hi,
As you mentioned in your comment, after any change of settings for MBRead block, you need to "reset" MBConnect block by switching of En parameter off/on in order to enable the new settings of MBRead block. I don't know the other way to switch the start address as you want, and most probably, it is not recommended after commissioning.
Due to the huge gap between 404010 and 403781 I recommend to use two MBRead blocks for that. They should work consequent - connect Req parameter of second block to Ndr parameter of the first block, and Req parameter of the first block to Ndr parameter of the second block. Ensure also first request (Req) to the first block by corresponding signal trough OR gate.
As you mentioned in your comment, after any change of settings for MBRead block, you need to "reset" MBConnect block by switching of En parameter off/on in order to enable the new settings of MBRead block. I don't know the other way to switch the start address as you want, and most probably, it is not recommended after commissioning.
Due to the huge gap between 404010 and 403781 I recommend to use two MBRead blocks for that. They should work consequent - connect Req parameter of second block to Ndr parameter of the first block, and Req parameter of the first block to Ndr parameter of the second block. Ensure also first request (Req) to the first block by corresponding signal trough OR gate.
by epelt Rank: 1940 on 11/9/2020 11:37:24 PM | Like (0) | Report
After I reset MBConnect, I can read another register with the same MBRead. But I don't want to reset my connection everytime.
Add new comment